Re: Sed advice needed




On 31 May 2007, at 17:49, Tyler MacDonald wrote:

Piers Kittel <debian@xxxxxxxxxx> wrote:
"181","1324.014027","111.111.111.111","111.111.111.111","RTP","Payloa d t
ype=ITU-T H.261, SSRC=2008229573, Seq=54520, Time=1725612773, Mark"
"185","1324.078941","111.111.111.111","111.111.111.111","RTP","Payloa d t
ype=ITU-T H.261, SSRC=2008229573, Seq=54521, Time=1725616276"

I need to convert the above to the below:

"181","1324.014027","111.111.111.111","111.111.111.111","RTP","54520"
"185","1324.078941","111.111.111.111","111.111.111.111","RTP","54521"

This *might* work, it depends on the rest of your dataset;

sed -e 's/,"Payload.*Seq=//' -e 's/, Time=.*$/"/'

Cheers,
Tyler

That wasn't quite perfect, but I worked out a bit how the command works and modified it - it now works like a dream! You're a lifesaver :) I really appreciate this! I will learn exactly how the command works - sed does seem quite powerful.

Thanks again!

Regards - Piers


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • RE: redhat-list digest, Vol 1 #8511 - 29 msgs
    ... To subscribe or unsubscribe via the World Wide Web, ... Command running on terminal at some intervals (Reuben D. ... Re: bash shell ... rsync with public/private keys/no passwords ...
    (RedHat)
  • RE: redhat-list digest, Vol 1 #8511 - 29 msgs
    ... To subscribe or unsubscribe via the World Wide Web, ... Command running on terminal at some intervals (Reuben D. ... Re: bash shell ... rsync with public/private keys/no passwords ...
    (RedHat)
  • FW: Re: psql command
    ... '>'run .bashrc after an edit, either by logging out and back in, or by ... '>'sourcing it on the command line. ... '>'with a subject of "unsubscribe". ... Trouble? ...
    (Debian-User)
  • Re: vim like completion in bash?
    ... If the OP still wants to make bash behave the same as mine -- among ... output of the "shopt" command ... there might be compile-time options that are relevant to TAB ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: usb2 port gets very slow on 2-gig Flash Drive.
    ... You make all the filesystem changes to a disk image on your hard disk, ... It is July 24 and ps ax -Olstart shows me that tar has ... several minutes between the rm -r -f command to wipe the FAT ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)