To convert an xlsx file to csv in command line, you can use the following if you have libreoffice installed
libreoffice --headless --convert-to csv file.xlsx
To convert an xlsx file to csv in command line, you can use the following if you have libreoffice installed
libreoffice --headless --convert-to csv file.xlsx
Problem
You have a text file that has empty lines, and you would like to remove them.
Solution
You can use awk in linux like the following to create a new file with the empty lines removed:
awk 'NF' file_with_blank_lines > file_without_blank_lines
Problem
You have two big tables in MySQL (>640K records), that maybe differ in the number of fields, but you want to make sure that the data in the common fields in both tables are the same.
Solution
mysql>SELECT common_field1, common_field2, ... INTO OUTFILE '/tmp/first_table.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM table1;
use seconddb;
Export the second table in the second file:
mysql>SELECT common_field1, common_field2, ... INTO OUTFILE '/tmp/second_table.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM table2;