Help with sed/awk ?

From: Oxy (oxaze_at_hotmail.com)
Date: 04/19/04


Date: 19 Apr 2004 11:14:23 -0700

Hello all,

When I dump (parts) of a postgres database into a textfile I get it in
the following format (each users data on three rows). The reason for
it is probably that the last field contain cr/lf characters.

-------------------------------------------------------

45|User1|Lastname||555-12345||Fakestreet 1
ODF4/145:146
dBm: 13.3

46|User2|Lastname||555-12346||Fakestreet 2
ODF2/43:44
dBm: 13.42

47|User3|Lastname||555-12347||Fakestreet 3
ODF5/7:8
dBm: 13.36

-------------------------------------------------------

What I want but haven't been able to achieve is to join each users
data into one single line. Move/append all text on line two to the
end of line one (separating each lines data with a comma) and then
do the same for all text on line three onto the end of line two.

I assume this can be done using sed or maybe even awk - but can
someone tell me the correct syntax for it ?

Thanks!

// O



Relevant Pages

  • Re: Help with sed/awk ?
    ... > When I dump of a postgres database into a textfile I get it in ... > the following format (each users data on three rows). ... > dBm: 13.3 ...
    (comp.unix.misc)
  • Re: Help with sed/awk ?
    ... > When I dump of a postgres database into a textfile I get it in ... > the following format (each users data on three rows). ... > dBm: 13.3 ...
    (comp.unix.shell)
  • Re: Help with sed/awk ?
    ... You need GnuPG to verify this message ... > the following format (each users data on three rows). ... > dBm: 13.3 ...
    (comp.unix.shell)
  • Re: Help with sed/awk ?
    ... >When I dump of a postgres database into a textfile I get it in ... >the following format (each users data on three rows). ... >I assume this can be done using sed or maybe even awk - but can ...
    (comp.unix.shell)