Converting txt file to csv file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Converting txt file to csv file
# 1  
Old 12-15-2009
Converting txt file to csv file

Hi,

Using rsync, I've sent the output to a text file. This is the text file :

Quote:
receiving file list ... done
./
myob_2009-10-27_12h31m.Tuesday.sql
myob_2009-10-28_12h30m.Wednesday.sql
myob_2009-12-08_12h30m.Tuesday.sql.gz
myob_2009-12-09_12h30m.Wednesday.sql.gz
myob_2009-12-10_12h30m.Thursday.sql.gz
myob_2009-12-11_12h30m.Friday.sql.gz
myob_2009-12-13_12h30m.Sunday.sql.gz
myob_2009-12-14_12h30m.Monday.sql.gz

sent 202 bytes received 65914295 bytes 232502.63 bytes/sec
total size is 165536145 speedup is 2.51
Pls help me on converting this text file to a csv file. Probably a script or sth to convert the text file to a csv file.
# 2  
Old 12-16-2009
A csv file is a text file. It can also be arranged in many different ways.

what do you want the output to look like?
# 3  
Old 12-16-2009
Like how a normal excel spread sheet would look like. With column and row headings. I want to convert that csv file to an excel sheet.

Another question is, where do I locate the converter script? Where does it have to be in order for me to automatically convert the created text file into csv and then excel? I don't have to do anything. It has to be automatically done.
# 4  
Old 12-16-2009
Code:
gawk -vRS="" 'NR==1{ gsub(/\n/,",");gsub(/.*\.\//,"");print}' file

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get Data From CSV File and put into a txt file

Hi Guys, File A I have File A as CSV Format.... No R SS MK Par value S AL A1 PKL123 Lo12 1 S AL A2 PKl123 Lo34 22 S AL A3 PkLK234 Lo67 -34 S AL A4 PkLK235 Lo09 120 S AL A5 PkLK236 Lo76 19 S AL A6 PkLK237 Lo44 -17 S AL A7 PkLK238 Lo90 2 S AL A8 PkLK239 Lo34 -9 I want file B like... (4 Replies)
Discussion started by: asavaliya
4 Replies

2. Shell Programming and Scripting

Converting txt file into CSV using awk or sed

Hello folks I have a txt file of information about journal articles from different fields. I need to convert this information into a format that is easier for computers to manipulate for some research that I'm doing on how articles are cited. The file has some header information and then details... (8 Replies)
Discussion started by: ksk
8 Replies

3. Shell Programming and Scripting

Converting txt file to Excel file

Hi All, I have a text file with below content. TradeDate Name SecurityMnc ReasonDesc ======================================= 20120501 Robin ABC FO System Defect 20120502 Robin ABC FO System Defect I would want this in an excel file in 4 columns,... (3 Replies)
Discussion started by: robinbannis
3 Replies

4. UNIX for Dummies Questions & Answers

cleaning up spaces from fixed width file while converting to csv file

Open to a sed/awk/or perl alternative so that i can stick command into my bash script. This is a problem I resolve using a combination of cut commands - but that is getting convoluted. So would really appreciate it if someone could provide a better solution which basically replaces all... (3 Replies)
Discussion started by: svn
3 Replies

5. Shell Programming and Scripting

Converting txt file in csv

HI All, I have a text file memory.txt which has following values. Average: 822387 7346605 89.93 288845 4176593 2044589 51883 2.47 7600 i want to convert this file in csv format and i am using following command to do it. sed s/_/\./g <... (3 Replies)
Discussion started by: mkashif
3 Replies

6. UNIX for Advanced & Expert Users

Converting .csv file into .xls file and send it to inbox

Hi All, I wrote a script to extract data from Oracle DB and place it in a text file , and I have coverted .txt file into comma seperated .csv file and I sent it to my mail box . I can get .xls file in my inbox.I am getting all data in same column and in different rows , without column... (1 Reply)
Discussion started by: krthkmuthu
1 Replies

7. UNIX for Advanced & Expert Users

Problem in converting password protected excel file to csv file in unix

I need to convert a password protected excel file which will be in UNIX server to a comma separated file. For this I need to open the excel file in UNIX box but the UNIX box doesn't prompt for password instead it is opened in an encrypted manner. I could manually ftp the excel file to local... (2 Replies)
Discussion started by: Devivish
2 Replies

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

9. UNIX for Advanced & Expert Users

converting a .txt file to comma delimeted file

Dear all, I have a file with 5L records. one of the record in the file is as shown below. MARIA THOMAS BASIL 1000 FM 1111 MD ... (1 Reply)
Discussion started by: OSD
1 Replies

10. Shell Programming and Scripting

converting .txt to comma delimeted file

Dear all, I have a file with 5L records. one of the record in the file is as shown below. MARIA THOMAS BASIL 1000 FM 1111 MD GHANA YY 77354 4774 99999999 1234567 I need to convert this record in below format "","","","","MARIA","THOMAS","BASIL","","1000 FM 1111 MD","STE... (1 Reply)
Discussion started by: OSD
1 Replies
Login or Register to Ask a Question