Kirk Wythers wrote:

On Oct 23, 2008, at 11:09 PM, John W. Krahn wrote:

Kirk Wythers wrote:
Below is snipit of code that is intended to read in the station_id from the header of each example file. In each case the reg expression is supposed to find the 6 digit number within the parentheses. Both files contain 6 lines in the header. For some reason the reg expression will not catch the station_id in the 2nd example. Oddly however, if I paste the data portion of the first file, into the 2nd file, then the the reg expression catches the station id in the 2nd example. Any ideas?

I tried your example as posted and it does print out the station_id from each file.

Thanks for the reply John. I also tried pasting the code into new files and the code worked. Could there be any kind of oddities in the original text files that would interfere? I am using emacs to view and edit, so I assume that weird windows carriage returns would show up.

Any other ideas?

It looks like you are posting from an Apple machine? Are you running the code on the same machine that you edited it on? Is the data generated on the same machine that the code is running on?

It *could* be related to the end-of-line character(s) but it is hard to diagnose from this distance. :-)



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to