Posted on 2010-11-25
Last Modified: 2012-08-14

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
Question by:faithless1
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

Expert Comment

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.

Accepted Solution

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"

Expert Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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 ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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