How to convert excel file to csv file or text file?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to convert excel file to csv file or text file?
# 1  
Old 03-20-2013
How to convert excel file to csv file or text file?

Hi all,

I need to find a way to convert excel file into csv or a text file in linux command. The reason is I have hundreds of files to convert. Another complication is the I need to delete the first 5 lines of the excel file before conversion.

so for instance

input.xls
Code:
description of files
date
la alalalalal
alalall
alalal
var1 var2 var3 var4 var5
1 2 3 4 5

output.csv or text file i want is
Code:
var1 var2 var3 var4 var5
1 2 3 4 5

Hope this is clear. Thanks!
# 2  
Old 03-20-2013
I recall using xls2txt or the like. xls2txt - Google Search After that, the filtering and formatting is simple. The PERL bits even exist to do the newer xlsx.
# 3  
Old 03-20-2013
csv is text... If it's saved as csv, fait accompli.
# 4  
Old 03-21-2013
Above file "input.xls" definitely is neither EXCEL format - which is binary - nor CSV format. It's just a plain, space separated text file, as is "output.csv".

For chopping 5 first lines from text files, use e.g. awk 'NR>5' input.txt
# 5  
Old 03-21-2013
Excel can both understand and create these files, nonetheless.
# 6  
Old 03-22-2013
document converter

We can use a document converter to convert a file from 1 format to another. And it's easily available.
# 7  
Old 03-22-2013
I took it that the input.xls file is xls, just described in text. So you need an xls2txt or xls2csv.

In the excel context, text had columns tab delimited, but CSV is more than comma deilimited, with quoting and quote escape rules. In the following example, this is one row of 3 cells in CSV:
Code:
1,2,"The strange man cried out ""You did't steal my hat, did you?""
I replied ""No, I certainly did not!"""

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

2. UNIX for Beginners Questions & Answers

Convert Excel File (xls) to tab delimited text file on AIX

Hi i have a problem in my job i try to convert an excel file (xls extention) to text file (tab delimited), but no result with this comand cat xxx.xls > xxx.txt Do you have eny idea? PS: sorry for my english Thanks!! (4 Replies)
Discussion started by: frisso
4 Replies

3. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

4. Shell Programming and Scripting

Need to convert text file into Excel sheet

:cool:Hi, Iam new to this Scripts and forum too. Plz excuse if may i ask silly questions now and further.. Prob: i need to convert txt files data into excel sheet. Suppose if i have hour-wise data in txt file1 and file2 like file1 file2 00: 140 00: 235 01: 160 01:415... (1 Reply)
Discussion started by: mrudula
1 Replies

5. Shell Programming and Scripting

Need to convert delimited text file in UNIX to an Excel file

Dear Users , Need to convert delimited text files in UNix server to an Excel file and move the excel file to Windows environment. Am trying to automate the whole process. Can anyone share the ideas,if they have done similar ones before...Thanks -Meera (1 Reply)
Discussion started by: meerakrish
1 Replies

6. Shell Programming and Scripting

Awk to convert a text file to CSV file with some string manipulation

Hi , I have a simple text file with contents as below: 12345678900 971,76 4234560890 22345678900 5971,72 5234560990 32345678900 71,12 6234560190 the new csv-file should be like: Column1;Column2;Column3;Column4;Column5 123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies

7. Programming

convert text file to csv

hi all, i have a select query that gives me the output in the following way... SYSTYPE -------------------------------------------------------------------------------- Success Failures Total RFT ---------- ---------- ---------- ---------- TYP 1 0 ... (3 Replies)
Discussion started by: sais
3 Replies

8. Shell Programming and Scripting

How to convert a excel file to a .csv file from unix script

Hi I have a excel file in unix machine and have to convert it into a .csv file.I have to do this from a unix script.How do we do this? Thanks Abhinav (3 Replies)
Discussion started by: akashtcs
3 Replies

9. Shell Programming and Scripting

how to convert fields from a text file to excel columns

i have this file which has the following contents: ,-0.3000 ,-0.3000 ,-0.3000 ,-0.9000 ,-0.9000 ,-0.9000 i would like to get this: -0.3-0.9-0.3-0.9-0.3-0.9 so far i am trying: awk '{for(i=1; i<=NF; i++) {printf("%f\n",$i)}}' test1 > test2 any help... (4 Replies)
Discussion started by: npatwardhan
4 Replies

10. Shell Programming and Scripting

text file to excel or csv

Hi, I have a text file like ---------------------- aaa|bbb|ccc|ddd|eee fff|gggg|hhhhhh|kkkk -------------------- I have a script which will transfer(thourgh FTP) this text file to windows system. But I want to covert it into excel or CSF then upload into windows system.. thanks (9 Replies)
Discussion started by: srikanthus2002
9 Replies
Login or Register to Ask a Question