Quote:
Originally Posted by
ajcannon
Not absolutely sure this is what you want but.....
cat filename | sed 's/TAS2/TAS/g'
In my test this results in...
.TAS ;
TAS;
TAS
lnput TASPX ;
output STAS;
.TAS();
TAS(8'h00); // timer TAS.
TAS(8'h00); // timer TAS.
TAS (8'h00); // timer TAS.
TAS (8'h00); // timer TAS.
TAS( 8'b000); // timer TAS.
TAS ( 8'b000); // timer TAS.
TAS(8'h00); // timer TAS.
it preserves the spacing so I am not sure if this is what you want
Sorry I made a mistake in giving my input file . now I corrected in my previouse post .
Thanks for your kind reply and time.. But actually the above will replace all the occurances of TAS2 to TAS. which will drastically change my files which i dont want..
So it should change only when matches my patteren
My patteren is like following
1.starting with zero/one/ more spaces or tabs
2.then
TAS2
3.zero/one/ more
spaces or tabs
4. then opening parenthesis "("
5.zero/one/ more
spaces or tabs
6.
8 followed by "
' "
7.any character
"o","b","h" or "d"
8.then followed by any no charater
[a-f| A-F| 0-9]
9.zero/one/ more
spaces or tabs
10.then closing
")" parenthesis
11.zero/one/ more
spaces or tabs
12. finishing with a
";"
an example :- TAS2 ( 8'h00) ;
Where it will find that above expression it should replace TAS2 to TAS but no other changes in that lin.
Earlier I tried with the follwing command but I failed
grep "^[ \t]*TAS2[ \t]*([ \t]*8'[b|o|d|h][0-9|a-f|A-F]*[ \t])[ \t]*;" ad0_signstbin_002.file | sed 's/TAS2/TAS/g'
One more thing I cant able make a ditto copy of my file becoz all tabs and spaces it squezes automatically after posting .
Hope this time my explanation is clear and watting for your reply
User_pradyu