Solved

CSV to TXT

Posted on 2010-11-25
3
909 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
  • 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now