Hi,
I'm working on updating a line in an XML-file by adding a new ending. I have done this by first stripping off the old part of the line for so to add the new ending of the line ( $new_line=`echo "$old-part" "new-part") . However, when I add the last new part, it's put in with a linebreak or two. I've tried all kinds of removes, but without luck. Ex: $new_line=~ s/\ \n//g; and $new_line=~ s/\\n//g;
Any ideas as to how to fix this?
Thank you!
-Inger LIn
Well, first thing to do would be rewrite it in PHP (unless you're in the wrong forum :-)
$new_line=preg_replace('/\ \n/','',$new_line);
And I leave the other up to you 🙂