[oclug] Re: sed problem
Vytas Janusauskas
vytas at magma.ca
Thu Apr 21 14:49:09 EDT 2005
Hi,
I have a problem that I hope can be easily be solved. I have a bunch of
files in which I wish to substitute the # character with the &
character. So I build a script containing sed commands as shown below.
sed -e 's/#/&/g M021D14.AML > A021D14.AML
etc ....
I did try running the command on the command line no error but also no
substitution is occurring.
When I test the similar command with the sample below which I pulled
for a tutorial the results are as expected.
cat file
the black cat was chased by the brown dog
>sed -e 's/black/white/g' file
the white cat was chased by the brown dog
A section of the *.AML file contains the following sample snippet of
text: I do not know if it makes any difference the *.AML files are
created in a Windows environment
#args MapName
#if [null %MapName%] &then
#return Map name was not specified.
#severity #error #ignore
workspace t:\b1\%MapName%
#severity #error #routine problem
#IF [exists brp -cover] #then kill brp all
append brp Point
\B1\031g13\boat_ra_p
end
#IF [exists cbrp -cover] #then kill cbrp all
#IF [exists cbrp%MapName%.shp -file] #then #if [delete cbrp%MapName%.shp
-file]
= 0 #then #type shp file deleted.
#IF [exists cbrp%MapName%.shx -file] #then #if [delete cbrp%MapName%.shx
-file]
= 0 #then #type shx file deleted.
#IF [exists cbrp%MapName%.dbf -file] #then #if [delete cbrp%MapName%.dbf
-file]
= 0 #then #type dbf file deleted.
clip brp clip cbrp Point 0.00000001
build cbrp Point
Thanks
Vytas
More information about the OCLUG
mailing list