Oct 27, 2003 #1 darfader Programmer Aug 6, 2003 38 GB Hi, I am currently opening a file and using this command :%s / /;/g replacing a tab with a semi-colon, I was just wondering if I could do it without manually opening the file ? tia,
Hi, I am currently opening a file and using this command :%s / /;/g replacing a tab with a semi-colon, I was just wondering if I could do it without manually opening the file ? tia,
Oct 27, 2003 #2 grega Programmer Feb 2, 2000 932 GB You could do sed 's/ /;/g' filename > newfile Greg. Upvote 0 Downvote
Oct 27, 2003 #4 predamarcel IS-IT--Management Jan 6, 2003 268 RO you can use also vi: vi +'%s/ /;/g|wq' x.txt or vi +'%s/ /;/g|wq newfile' x.txt PM Upvote 0 Downvote
Oct 27, 2003 #5 aixmurderer IS-IT--Management Nov 28, 2000 603 NZ I got lazy, found a package called "rpl" which does replaces very nicely and easily. IBM Certified Confused - MQSeries IBM Certified Flabbergasted - AIX 5 pSeries System Administration MS Certified Windblows Rebooter Upvote 0 Downvote
I got lazy, found a package called "rpl" which does replaces very nicely and easily. IBM Certified Confused - MQSeries IBM Certified Flabbergasted - AIX 5 pSeries System Administration MS Certified Windblows Rebooter
Oct 28, 2003 Thread starter #6 darfader Programmer Aug 6, 2003 38 GB thanks chaps, I think I'll stick with the SED one, I have just read that if I wanted to do more than one at time, I could use the -e flag Upvote 0 Downvote
thanks chaps, I think I'll stick with the SED one, I have just read that if I wanted to do more than one at time, I could use the -e flag
Oct 28, 2003 #7 predamarcel IS-IT--Management Jan 6, 2003 268 RO same thing you can do in vi, look at `|'. vi +'command1|command2|...|command_n' file PM Upvote 0 Downvote
Oct 28, 2003 Thread starter #8 darfader Programmer Aug 6, 2003 38 GB well well well thanks predamarcel Upvote 0 Downvote