in reply to Perl Issue - File downloaded in windows has a Control M character in it??

The effect of unix2dos can be effortlessly achieved by a m/// regular-expression which is left as an exercise to the reader.
  • Comment on Re: Perl Issue - File downloaded in windows has a Control M character in it??

Replies are listed 'Best First'.
Re^2: Perl Issue - File downloaded in windows has a Control M character in it??
by Anonymous Monk on Oct 24, 2012 at 19:35 UTC
    what regular expression? i am new to perl and i have been assigned to do this...i am an ETL guy
      s/\r\n/\n/g should do it.

      See perldoc perlop and search for "Regex Quote-Like Operators." Also see perldoc perlre.

      This command replaces the \r\n sequence with \n for every occurrence in the string.

      Most of the time these commands invoke sed scripts, which can apply a regular-expression to modify the content of a file.