Format txt file to CSV


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Format txt file to CSV
# 1  
Old 04-20-2009
Format txt file to CSV

Hi All,
I have a file with content
FLIGHT PLANS PRODUCED ON 26.08.2008(SORTED BY FPLAN NUMBER) RUN DATED 27/08/08 PAGE 1
--------------------------------------------------------------

FPLAN FPLAN PRE BTCH BATCH POST BTCH BATCH BATCH BATCH BATCH BATAP TDF TOTAL AIRLINE S G A T C A O N D C
NO PROCESS PROCESS PROCESS PROCESS ELAPSED T-ARND CPU DISK SUBMIT TOTAL CK/HLD AND W R F D H R F T T P
TOTAL TOTAL TOTAL TOTAL TOTAL TIME TIME TIME IO CNT TOTAL DELAY TIME FLIGHT X F T F K B C M E N

GPT85 21.22.40 21.22.28 11 1 11 12 2 1541 1 21.22.28 SYL501A01 Y Y N Y N N N Y N N
GPT87 21.22.22 21.22.11 9 2 9 10 2 1545 2 21.22.11 SYL502A01 Y Y N Y N N N N N N
GPT9B 21.42.04 21.41.55 9 0 7 9 2 1547 0 21.41.45 SYL373 01 Y Y N Y N N N N N N
GPT9D 21.42.04 21.41.53 11 0 10 11 3 1548 0 21.41.52 SYL993801 Y Y N Y N N N N N N
GPT9G 31.10.08 31.09.51 16 1 14 15 3 1544 1 31.09.50 SYL782 01 Y Y N Y N N N N N N
GPT9H 31.10.19 31.09.50 20 9 18 20 2 1549 9 31.09.50 SYL781 01 Y Y N Y N N N N N N
GPT9M 26.19.35 26.19.15 19 1 19 19 3 1544 1 26.19.14 SYL727 01 Y Y N Y N N N N N N
(attached the file for the reference)
I need to arrange these to get in CSV/exel format. It may be perl/shell script t do so.
I tried to rename to csv and tried opening in exel but the fileds are not separated..
Please help
Raghava
# 2  
Old 04-20-2009
This is not your 1st time in the forum - please start using CODE TAGS, ty. That's the edit option with the # up there in the tool bar.

Maybe change all the blanks (if appropriate) by semicolons and tell excel then to import it by having delimeter ";".
Look into tr or sed for example to get this done.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need script to convert TXT file into CSV

Hi Team, i have some script which give output in TXT format , need script to convert TXT file into CSV. Output.TXT 413. U-UU-LVDT-NOD-6002 macro_outcome_dist-8.0.0(v1_0_2) KK:1.2.494 (1234:333:aaa:2333:3:2:333:a) 414. U-UU-LVDT-NOD-6004 ... (10 Replies)
Discussion started by: Ganesh Mankar
10 Replies

2. UNIX for Dummies Questions & Answers

Format txt file in UNIX

Hello All, I have File_all.txt which have content as below Volume in drive E is Data Volume Serial Number is 586D-6932 Directory of E:\mydi2\siudfor\TFG058 03/27/2014 09:59 PM 5,569 FX\FX01 my4_pg4_MON_20140327_C.zip 1 File(s) 5,569 bytes ... (5 Replies)
Discussion started by: kumar30213
5 Replies

3. Shell Programming and Scripting

Need help to format one txt file to required format

Hello Everyone, I have one source file which is genarated by SAP in different format(Which I've never seen). I need to convert that file to required format and I need to read this target file from Datastage to use this in my Jobs. So I do not have any other options except to use Unix script to... (4 Replies)
Discussion started by: Prathyu
4 Replies

4. UNIX for Dummies Questions & Answers

How to create a .csv file from 2 different .txt files?

Hi, I need to create a .csv file from information that i have in two different tab delimited .txt file. I just want to select some of the columns of each .txt file and paste them into a .cvs file. My files look like: File 1 transcript_id Seq. Description Seq. Length ... (2 Replies)
Discussion started by: alisrpp
2 Replies

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

6. Shell Programming and Scripting

awk to print value from txt file to csv

Hi, I want to print two columns from a .txt file to a .csv file using awk. data in text file: Application -------------------------------------------------- ----------- OS Related Issues 1 EMEA Solutions ... (8 Replies)
Discussion started by: prashu_g
8 Replies

7. Shell Programming and Scripting

txt file to CSV

hi.. I have a text file which looks likes this 2258 4569 1239 258 473 i need to convert it into comma seperated format eg:2258,4569,1239,258,437 pls help (8 Replies)
Discussion started by: born
8 Replies

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

9. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

10. Shell Programming and Scripting

How to format a txt file using typeset?

Hi all, i have a file toto.txt : blabla;toumtoudoum;blablabla toumtoudoumtoudoum;blabla;popopopo blablabla;etcetcetc;blabla etc.... As you can see, it is a simple file containig 3 fields separated by a ";". What i want to do is to display this file with a nice formating... (4 Replies)
Discussion started by: HowardIsHigh
4 Replies
Login or Register to Ask a Question