> From: Westcott Andrew-AWESTCO1 [mailto:[EMAIL PROTECTED] > Sent: Sunday, 22 February 2004 10:08 PM > To: '[EMAIL PROTECTED]' > Subject: Help with end of line charaters > > Hi, > > I'm new to perl but need to write a script that takes a file > and formats > lines. > > The file has to 2 fields that are tab separated and each > field is made up of > items separated by some type of linefeed character. The end > of the second > field is identified by another type of linefeed character. > > When I view the file in VIM the second linefeed shows as a ^M > so there must > be a way of identifying these separately. > > I have tried searching for \r \n %CR %LF $VT $FF but nothing > seems to give > the required effect. > > I need to run the script on a PC. > > Please can you offer some advice or possible places to look. > > Thanks > > Andy
Please provide the code you have been testing, so we can offer suggestions against it. Otherwise it sounds like homework :-) PS, check out 'perldoc perlre', and try to understand the 'm' and 's' options. They affect how newline and linefeed characters are used in perl. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>