• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 920
  • Last Modified:

CSV to TXT

Hi,

Is there a quick way to rename/convert all files in a directory (csv, xls, txt) and pipe it to a single file so they can be viewed in a terminal?

Thank you
0
faithless1
Asked:
faithless1
  • 2
1 Solution
 
brb6708Commented:
csv is txt so it is easy to show it in a terminal

cat *.csv *.txt |less -S

xls is Excel and for that you need some converter to do that. Normal text viewers only show garbage with this kind of files.
0
 
VryaliCommented:
You can use xls2csv to conver the excel files.  I'm a little confused as to what you're exactly trying to do, though.  Using cat file1 >> finalfile on all the files in the folder would make a single large file.

You could use a simple for loop off xls2csv to convert everything and then a second for loop to combine them all together, but again it seems unclear what you're trying to do.

The usage for xls2csv would be like:

xls2csv -x "test.xls" -w "Sheet1" -c "test.csv"
0
 
brb6708Commented:
xls2csv is normally not in the standard distributions. In debian based opackages you'll get it by apt-get install catdoc
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now