Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to generate a comma delimted file for export to OO 1

Status
Not open for further replies.

jdespres

MIS
Aug 4, 1999
230
US
I have written a script that collects data on tapes and tape usage...

I send the output out via email....

This output in email looks like this:

Info1: DataA
Info2: DataB
Info3: DataC
Info4: DataD
Info5: DataE
Info6: DataF
Info7: DataG
Info8: DataH
Info9: DataI

I would like to append the Data I generate to a comma delimted file so I can export out to Open Office...

Initially the file I send it to will have the following:

What
Info1
Info2
Info3
Info4
Info5
Info6
Info7
Info8
Info9

These info's identify the data and will go into the file only once...

The next day my script runs and the following should happen:

What, mm/dd/yy
Info1, DataA
Info2, DataB
Info3, DataC
Info4, DataD
Info5, DataE
Info6, DataF
Info7, DataG
Info8, DataH
Info9, DataI

and of course the next day:

What, mm/dd/yy, mm/dd/yy
Info1, DataA, DataJ
Info2, DataB, DataK
Info3, DataC, DataL
Info4, DataD, DataM
Info5, DataE, DataN
Info6, DataF, DataO
Info7, DataG, DataP
Info8, DataH, DataQ
Info9, DataI, DataR

I guess it boils now to: How can I append or insert the data generated into a file that I will later export to Open Office... and have the data goto the proper line within the file?

Thanks...

Joe Despres
 
What have you tried so far and where in your code are you stuck ?
You may consider awk.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If the same number of lines are always produced in the same order, the paste command may also be useful.

Annihilannic.
 
I got paste to work....

paste -d "," file1 file2 > file3

Joe Despres
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top