|
Re: can sed take take several line to produce multiple output: msg#00028editors.sed.user
shamrul ismawi wrote: > The input file is using same format for every 2 > line(delimiter is ,) > > > Can sed take the following input: > > header,login - telnet ssh, Thu Dec 08 11:08:55 2005, > subject,abc,def,123,456, abc.linux.com.my > > > and produce: > > Thu Dec 08 11:08:55 2005, Name=abd 2name=def phone=123 > phone2=245 > From : abc.linux.com.my Access=telnet ssh Well, assuming that the first Name should be "abc" rather than "adb", the answer is yes. The trick is to read in the data in pairs of lines rather than one line at a time which is how sed operates by default. $ sed -f trial.sed input.txt Thu Dec 08 11:08:55 2005, Name=abc 2name=def phone=123 phone2=456 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Replacing a pattern in one file by reading a string from anotherfile: 00028, hq00e |
|---|---|
| Next by Date: | Re: can sed take take several line to produce multiple output: 00028, Tim Chase |
| Previous by Thread: | can sed take take several line to produce multiple outputi: 00028, shamrul ismawi |
| Next by Thread: | Re: can sed take take several line to produce multiple output: 00028, Tim Chase |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |