Re: [PLUG] File content modification

2010-08-11 Thread Toshish Jawale
Hi, At my terminal the command did work properly...! On Wed, Aug 11, 2010 at 4:10 AM, Manas Alekar maale...@gmail.com wrote: does not work, cat try.txt | cut -d '_' -f2- | rev | cut -d '_' -f2- | rev | tr -d '_' ___ Pune GNU/Linux Users Group Mailing

Re: [PLUG] File content modification

2010-08-10 Thread Manas Alekar
does not work, cat try.txt | cut -d '_' -f2- | rev | cut -d '_' -f2- | rev | tr -d '_' ___ Pune GNU/Linux Users Group Mailing List

Re: [PLUG] File content modification

2010-08-09 Thread Manas Alekar
cat try.txt | cut -d '_' -f2- | rev | cut -d '_' -f2- | rev Manas On Sat, Aug 7, 2010 at 2:38 AM, zoyd emailz...@yahoo.com wrote: On Tue, Aug 3, 2010 at 9:10 AM, Gaurav Pant gauravggs at gmail.com wrote: 2010/8/3 शंतनू (Shantanoo) shantanoo at gmail.com: On Sat, Jul 31, 2010 at 12:32,

Re: [PLUG] File content modification

2010-08-09 Thread Gaurav Pant
Hi. On Mon, Aug 9, 2010 at 11:01 PM, Manas Alekar maale...@gmail.com wrote: cat try.txt | cut -d '_' -f2- | rev | cut -d '_' -f2- | rev Manas does not work, leaves the underscores between the words. this is what u get. abc abc_xyz abc_pqr_xyz this is what is expected abc abcxyz abcpqrxyz

Re: [PLUG] File content modification

2010-08-04 Thread Nandan Marathe
On Tue, Aug 3, 2010 at 7:46 AM, Mayuresh mayur...@acm.org wrote: On Mon, Aug 02, 2010 at 11:08:44AM +0530, Nandan Marathe wrote: On Sun, Aug 1, 2010 at 2:40 PM, Mayuresh mayur...@acm.org wrote: the cat is unnecessary. Otherwise this looks the cleanest solution. cut -d_ -f2- temp | sed

Re: [PLUG] File content modification

2010-08-04 Thread Mehul Ved
On Sun, Aug 1, 2010 at 2:34 PM, Mehul Ved mehul.n@gmail.com wrote: Try 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. A little simpler sed -e 's/_/ /g' -e

Re: [PLUG] File content modification

2010-08-02 Thread Nandan Marathe
On Sun, Aug 1, 2010 at 2:40 PM, Mayuresh mayur...@acm.org wrote: On Sat, Jul 31, 2010 at 12:32:47PM +0530, Shreerang Patwardhan 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

Re: [PLUG] File content modification

2010-08-02 Thread Shreerang Patwardhan
Hello Shantanu, I have provided the actual data itself. The line starts with a 5 digit number and ends with the word county...Always! Regards, Shreerang Patwardhan. ___ Pune GNU/Linux Users Group Mailing List

Re: [PLUG] File content modification

2010-08-02 Thread Shantanoo
On Sat, Jul 31, 2010 at 12:32, Shreerang Patwardhan patwardhan.shreer...@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

Re: [PLUG] File content modification

2010-08-02 Thread Mayuresh
On Mon, Aug 02, 2010 at 11:08:44AM +0530, Nandan Marathe wrote: On Sun, Aug 1, 2010 at 2:40 PM, Mayuresh mayur...@acm.org wrote: the cat is unnecessary. Otherwise this looks the cleanest solution. cut -d_ -f2- temp | sed -e 's/_county//' -e 's/_//g' - Nandan cat is not put out of necessity.

Re: [PLUG] File content modification

2010-08-02 Thread Kulkarni Shantanu
* Shreerang Patwardhan patwardhan.shreer...@gmail.com [100803 08:26]: Hello Shantanu, I have provided the actual data itself. The line starts with a 5 digit number and ends with the word county...Always! Then my solution will work (although remember it is untested). Shantanu --

Re: [PLUG] File content modification

2010-08-02 Thread Gaurav Pant
2010/8/3 शंतनू (Shantanoo) shanta...@gmail.com: On Sat, Jul 31, 2010 at 12:32, Shreerang Patwardhan patwardhan.shreer...@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

Re: [PLUG] File content modification

2010-08-02 Thread Gaurav Pant
2010/8/3 शंतनू (Shantanoo) shanta...@gmail.com: On Sat, Jul 31, 2010 at 12:32, Shreerang Patwardhan patwardhan.shreer...@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

Re: [PLUG] File content modification

2010-08-02 Thread Gaurav Pant
On Tue, Aug 3, 2010 at 9:10 AM, Gaurav Pant gaurav...@gmail.com wrote: 2010/8/3 शंतनू (Shantanoo) shanta...@gmail.com: On Sat, Jul 31, 2010 at 12:32, Shreerang Patwardhan patwardhan.shreer...@gmail.com wrote: Hello all,     I have a file with contents in the following manner:

[PLUG] File content modification

2010-08-01 Thread Shreerang Patwardhan
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! I wish to convert the contents of this file in the form as specified

Re: [PLUG] File content modification

2010-08-01 Thread Kulkarni Shantanu
* Shreerang Patwardhan patwardhan.shreer...@gmail.com [100801 14:03]: 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

Re: [PLUG] File content modification

2010-08-01 Thread Mehul Ved
On Sat, Jul 31, 2010 at 12:32 PM, Shreerang Patwardhan patwardhan.shreer...@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

Re: [PLUG] File content modification

2010-08-01 Thread Mayuresh
On Sat, Jul 31, 2010 at 12:32:47PM +0530, Shreerang Patwardhan 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