[PLUG] File content modification
mehul.n.ved at gmail.com
Sun Aug 1 02:04:50 PDT 2010
On Sat, Jul 31, 2010 at 12:32 PM, Shreerang Patwardhan
<patwardhan.shreerang at gmail.com> wrote:
> Hello all,
> I have a file with contents in the following manner:
> Each entry is on a new line and each line begins with a number and ends with
> the word county!
> I wish to convert the contents of this file in the form as specified below:
sed -e 's/_/ /g' inputfile | sed -e 's/^ *[^ ]* //' | sed -e 's/^\(.*\)
.*/\1/' | sed -e 's/ //g' > outputfile
Not sure if there's a way to do it without piping it so many times.
More information about the plug-mail