To convert a txt file to .xls file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To convert a txt file to .xls file
# 1  
Old 01-16-2009
To convert a txt file to .xls file

i want to convert a comma seprated file into a .xls file
the file contains 3 fields seprated by a comma.
i want to convert it into a .xls file with 3 columns and 37 rows
Code:
 
DPRPT400,01/15/2009-15:03:06,01/15/2009-15:03:08
DPRPT401,01/15/2009-15:03:15,01/15/2009-15:03:32
DPRPT601,01/15/2009-22:00:48,01/15/2009-22:00:51
DPRPT406,01/15/2009-22:01:08,01/15/2009-22:28:32

Thanks in advance.
# 2  
Old 01-16-2009
Hi Mani,

Do you want to Open a comma seprated file in excel. Pls let me know if im wrong.

Thanks
# 3  
Old 01-16-2009
yes i want to open a comma seprated file in excel, but i want to automate this process,i need a code which will do the same.
thanks
# 4  
Old 01-16-2009
Hi Mani,

Let me know the input files are available in unix server. And also you want to open a
comma seprated file in excel thru unix script?
# 5  
Old 01-16-2009
ya the input file is available on the unix server with the name "dashboard.dat" i want to copy its content in a .xls file through a unix script.
# 6  
Old 01-16-2009
Hi manit,

Replace the commas with a tab using sed or whichever you prefer and save it with a .xls extension.

Excel recognizes tab delimited columns. Thus, when you open the file in excel it will be in a table format.
# 7  
Old 01-16-2009
hi
i had used the code
Code:
body { margin: 0 0 0 0; padding:0 0 0 0 }td,div { font-family:Tahoma;font-size:8pt;vertical-align:top }body { margin: 0 0 0 0; padding:0 0 0 0 }.transcript { background-color:#d2d2d2; }.messageBlock { margin-left:4px; margin-bottom:3px }.message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; }.messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;}.other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; }.showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; }.other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.tsDisplay { display:block } body { margin: 0 0 0 0; padding:0 0 0 0 }td,div { font-family:Tahoma;font-size:8pt;vertical-align:top }body { margin: 0 0 0 0; padding:0 0 0 0 }.transcript { background-color:#d2d2d2; }.messageBlock { margin-left:4px; margin-bottom:3px }.message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; }.messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;}.other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; }.showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; }.other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.tsDisplay { display:block } oldname="dashboard.dat"
bash-2.05$ newname=${oldname%%.txt}".xls"
bash-2.05$ mv $oldname $newname

but this code is giving all the fields in only 1 column instead of 3 columns
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Perl script to convert xlsx to xls file

Hi I am trying one perl script to convert xlsx to xls file but could not able to get all the rows and columns in the xls file . This scriptFILE is basically to convert XLSX to CSV .. I am tweaking the script to convert XLSX to XLS file also #######################FILE... (3 Replies)
Discussion started by: kshitij
3 Replies

3. Shell Programming and Scripting

How to convert a xls file to csv?

Hi, My requirement is to convert the xls to csv file with utf-8 conversion. Is there any way please suggest me. Thanks, Raja (4 Replies)
Discussion started by: cnraja
4 Replies

4. Shell Programming and Scripting

How to read from txt file and write it to xls?

Hello All, I just want help in coding a simple shell script since i am a newbie for UNIX and i started learning unix and shell scripting basics recently. I am having a data like this in .txt file. Product Name : XYZ Price : 678.1 Best Buy Price : 600 Product Name : ABC Price : 465... (3 Replies)
Discussion started by: vasanth_123
3 Replies

5. AIX

How to convert csv file to xls file

Hi All, I have a java program running in AIX machine which gives me the output in form of .CSV but my clients wants output in the form of .xls When I gave the command mv <filename.csv> <filename.xls> The contents of this .xls file is not exactly in seprate columns as in CSV, the contents... (1 Reply)
Discussion started by: chetu777
1 Replies

6. Shell Programming and Scripting

how to convert XLS to CSV and DOC/RTF to TXT

Hi, i don't know anything about PERL. Can anyone help me providing PERL scripts for 1. converting XLS to CSV (and vice-versa) 2. converting DOC/RTF to TXT Thanks much Prvn (1 Reply)
Discussion started by: prvnrk
1 Replies

7. Shell Programming and Scripting

converting xls file to txt file and xls to csv

I need to convert an excel file into a text file and an excel file into a CSV file.. any code to do that is appreciated thanks (6 Replies)
Discussion started by: bandar007
6 Replies

8. Shell Programming and Scripting

convert a txt file to xls file

How to convert a txt file(tab delimiter) to xls file. Looking forward help. Thanks, Venkatesh. (2 Replies)
Discussion started by: venkatesht
2 Replies

9. Shell Programming and Scripting

Convert a csv file to an xls format

Hi, I have a file coming in xxx.txt(csv format) i do some work on it and i need to send out as a .xls format. Is there any way there is some code i can use in my script to convert this? I'm struggling on this. Thanks (11 Replies)
Discussion started by: Pablo_beezo
11 Replies

10. Shell Programming and Scripting

How to input .txt file into .xls spreadsheet

I need to take the totals from my script and input them into a excel spreadsheet. Right now, I just copy and paste. Is there an easier way? 3906 is the total jobs in ABEND state 4005 is the total jobs in SUCC state 1050 is the total jobs in HOLD state (1 Reply)
Discussion started by: wereyou
1 Replies
Login or Register to Ask a Question