Re: Sed advice needed



On 05/31/07 11:05, Piers Kittel wrote:
Hello all,

I need to delete some words out of a large file containing information about packets I'm analysing. I know I can use sed to do this, but haven't really used it before, so am a bit unsure of how to do it. Two example lines are as of below:

"181","1324.014027","111.111.111.111","111.111.111.111","RTP","Payload type=ITU-T H.261, SSRC=2008229573, Seq=54520, Time=1725612773, Mark"
"185","1324.078941","111.111.111.111","111.111.111.111","RTP","Payload type=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"

What's the best way to do this? I've been reading the man pages of sed, cut and awk but I can't quite figure out how to do this. Any ideas?

Thanks very much for your time in advance!

awk might be a better fit for this.

--
Ron Johnson, Jr.
Jefferson LA USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!


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



Relevant Pages

  • Sed advice needed
    ... I need to delete some words out of a large file containing information about packets I'm analysing. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ... Trouble? ...
    (Debian-User)
  • Re: Grilling in packets
    ... fish, and they served it with these little foil packets of vegetables. ... seafood in reactive foil, and especially if it contained citrus too. ...
    (rec.food.cooking)
  • Re: Grilling in packets
    ... fish, and they served it with these little foil packets of vegetables. ... seafood in reactive foil, and especially if it contained citrus too. ...
    (rec.food.cooking)
  • Re: OT: Religion, Good and Evil (was Re: A way to compile 3rd party modules into deb system?)
    ... I see an internal American clash between, on the one hand, Christian ... I'd have thought you'd have recognized "Evel Knievel" as a Dutch name. ... Give a man a fish, and he eats for a day. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: [OT] Good, evil and religion [WAS] Re: A way to compile 3rd party modules into deb system?
    ... demos that they speaks for God, ... such blatantly non-Christian activity. ... Give a man a fish, and he eats for a day. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)