Someone sends you shop.sql and asks for "the customers in a spreadsheet". The usual advice is to install MySQL or PostgreSQL, restore the dump, then export. That is a lot of setup for one table.
You don't need any of it. A dump is a text file that already contains every row. You only need to know which of three formats you're looking at.
Step 1: look inside the file
Open it in any editor (or head -50 shop.sql ) and find the rows.
mysqldump writes multi-row INSERT s with no column names and backslash escapes:
CREATE TABLE `customers` ( `id` int NOT NULL AUTO_INCREMENT , `name` varchar ( 255 ) DEFAULT NULL , PRIMARY KEY ( `id` ) ) ENGINE = InnoDB ; INSERT INTO `customers` VALUES ( 1 , 'O\'Neil' ) , ( 2 , 'Sara \"S\"' ) ;
Enter fullscreen mode
Exit fullscreen mode
pg_dump (plain format) writes a COPY ... FROM stdin block: tab-separated, \N for NULL, ended by \. :
COPY public .…