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 fix that: perl -lpi.bak -w -e "s/\s+/ /g" map.bat -l basically chomp()'s each input line when it's read and then adds the \n back on when it's printed back out. Handy! > > Why should I use tr instead? You shouldn't in this case. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]