Solved

CSV to TXT

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 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

22 Experts available now in Live!

Get 1:1 Help Now