Converting Excel files to CSV in Linux

Install xls2csv

yum -y install xls2csv

To convert your xls file to csv, just type this command:

xls2csv filename.xls > filename.csv

This script is very useful if you have a lot of excel files to convert. This will help you save a lot of time than converting it one by one.

  1. #!/bin/bash
  2. ls *.xls | while read file
  3. do
  4. filename=`echo $file | cut -d . -f 1`
  5. xls2csv "$file" > "$filename".csv
  6. done

No votes yet

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may quote other posts using [quote] tags.

More information about formatting options