Paul Kraus wrote:
I want to replace all forward slashes with back slashes is a file.
Using a one liner I tried
perl -I -i.bak -w -e 's!/!\\!g' map.bat
1) You don't need -I
2) You do need -p
3) You probably need to use double-quotes instead of single, due to Windows
shell brain damage.
4)
]]
Sent: Friday, January 10, 2003 11:53 AM
To: 'Paul Kraus'; Perl
Subject: RE: one liner replace / with \
Paul Kraus wrote:
I want to replace all forward slashes with back slashes is a file.
Using a one liner I tried
perl -I -i.bak -w -e 's!/!\\!g' map.bat
1) You don't need -I
Paul Kraus wrote:
Now I wanted to replace any white space with a single space.
I used this command
perl -pi.bak -w -e s/\s+/ /g map.bat
That worked correctly but it removed all of my new lines.
Because new lines are whitespace. Adding -l (ell) to the perl command is the
easiest way to