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
# 8  
Old 01-16-2009
Code:
oldname="dashboard.dat"
bash-2.05$ newname=${oldname%%.txt}".xls"
bash-2.05$ mv $oldname $newname

# 9  
Old 01-16-2009
Hi Mani,

Jst try the below command.

sed "s/,/`echo "\t"`/g" t.dat > h.xls

Thanks
# 10  
Old 01-16-2009
The easiest way is to replace all commas with a TAB. It will only convert to 1 column because you don't have any TAB to serve as the delimiter.

Of course, if you choose not the save it as a .xls format you can still open it in excel and have excel do the work. Whenever excel opens a text file a wizard pops-up asking you stuff on how to read/delimit the file. It can be by using a delimiter or a fixed width. But then that wouldn't be automated enough now.

So I suggest, replace all commas first with a TAB (maybe using sed - https://www.unix.com/cfmgoogle.php?cx...sa=Search#1157) then save a copy with a .xls extension, let excel do the work, sit down and just relax.
# 11  
Old 01-16-2009
Thanks to both of u
its working
thanks...
# 12  
Old 01-16-2009
I work with Unix data under Excel as well. What I did was save the data as a txt file, and import the txt file into Excel and set it so that any space or punctuation will separate the data into their individual grid. I saved the steps into a macro. All I have to do from then on is pressing a hotkey bound to that macro.
 
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