简体   繁体   中英

XLS multiple files convert to single csv in Linux

On a daily basis, I have received 20.xls files in Linux box. Each file start from 6 row and convert into single.csv file. For example,

  • .xls file 1 contains 106 rows
  • .xls file 2 contains 206 rows
  • .xls file 3 contains 56 rows

All three files data convert into a single CSV file. Single CSV file count should be 350.

I am using the command below to convert, but it is working one by one file not bulk mode.

unoconv -f csv -e FilterOptions="59,0,0,1"  test_amount1.xls  
unoconv -f csv -e FilterOptions="59,0,0,1"  test_amount2.xls  
unoconv -f csv -e FilterOptions="59,0,0,1"  test_amount3.xls  

Can anyone let me know how to implement single shot all files conversion from.xls to.csv

Not sure what you want but I assume you want to convert each xls file, then concatenate them all.

for input in test_amount*.xls; do
    unoconv -f csv -e FilterOptions="59,0,0,1" --stdout $input | tail -n +7
done >output.csv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM