[PLUG] File content modification

Gaurav Pant gauravggs at gmail.com
Tue Aug 3 09:06:36 IST 2010


2010/8/3 शंतनू (Shantanoo) <shantanoo at gmail.com>:
> On Sat, Jul 31, 2010 at 12:32, Shreerang Patwardhan
> <patwardhan.shreerang at gmail.com> wrote:
>> Hello all,
>>     I have a file with contents in the following manner:
>> 10001_abc_county
>> 10003_abc_xyz_county
>> 10005_abc_pqr_xyz_county
>>
>> Each entry is on a new line and each line begins with a number and ends with
>> the word county!

 cat file  | sed -ne 's/^[0-9]\{5\}\+_//p' | sed -ne
's/\(_county\)$//p' | tr -d '_'

--dexter




More information about the Plug-mail mailing list