V
v796
Hi,
I have text on multiple lines in text files on Windows. Example:
" Your voting instructions have been
received.
Thank you! "
I need a regex to remove CR-LF and convert them to space in the middle
of the text. I tried this regex which works at the end.
$content =~ s/^([\s\S]+\S)\s*$/$1/;
This works to remove all CR-LF of Windows at the end an puts into $1.
I must remove the CR-LF in the middle too. How can this be done?
My script is running on Linux.
Finally, I have to import $content into a single column in Excel file.
Unfortunately, the excel file requirement just came up yesterday, else
I would have used CPAN WriteExcel module. Oh well!
Currently the text in excel writes to multiple lines in Excel file,
when it should only be in 1 cell.
Any comments are appreciated.
Thanks,
vk
I have text on multiple lines in text files on Windows. Example:
" Your voting instructions have been
received.
Thank you! "
I need a regex to remove CR-LF and convert them to space in the middle
of the text. I tried this regex which works at the end.
$content =~ s/^([\s\S]+\S)\s*$/$1/;
This works to remove all CR-LF of Windows at the end an puts into $1.
I must remove the CR-LF in the middle too. How can this be done?
My script is running on Linux.
Finally, I have to import $content into a single column in Excel file.
Unfortunately, the excel file requirement just came up yesterday, else
I would have used CPAN WriteExcel module. Oh well!
Currently the text in excel writes to multiple lines in Excel file,
when it should only be in 1 cell.
Any comments are appreciated.
Thanks,
vk