$ cat foo This is line 1 This is line 2 This is line 3 $ perl -pe 's/$/\\par/' foo > bar $ cat bar This is line 1\par This is line 2\par This is line 3\par $
Hope this helps Tobias -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris O Sent: Sunday, November 19, 2006 11:47 AM To: perl-win32-users@listserv.ActiveState.com Subject: Stumped... Replace line endings I have blocks of text in my MS SQL database that look like... This is line 1 This is line 2 This is line 3 I want to reformat them like... This is line 1\par This is line 2\par This is line 3\par (I'm writing documents in RTF Format, which use \par\n in place of \n) The problem is that Perl refuses to replace the line endings when I try... $text=~s/\n/\\par\n/g; I'm stumped and can't find anything online. Should I be using something other than \n to detect line endings? - Chris _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs