Solved

CSV to TXT

Posted on 2010-11-25
3
916 Views
Last Modified: 2012-08-14
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
Comment
Question by:faithless1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:brb6708
ID: 34211276
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
 
LVL 3

Accepted Solution

by:
Vryali earned 500 total points
ID: 34213711
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
 
LVL 6

Expert Comment

by:brb6708
ID: 34214253
xls2csv is normally not in the standard distributions. In debian based opackages you'll get it by apt-get install catdoc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question