opening a file
- From: George <george@xxxxxxxxxxxxxxx>
- Date: Wed, 7 Jan 2009 19:50:14 -0700
I thought I would use perl instead of fortran to parse a text file, what
with the new m// s/// capabilities at my fingertips.
So it is that I need to open a text file and send it to STDOUT. This may
come across as a contemptable FAQ to some. I've just looked at all the
entries with the string 'file' beginning them in the index of the camel
book, and it's huge and ambiguous to a guy who is not in the native perl
environment, ie, a server, but simply needs to get a little io on windows.
This is what I have so far:
use strict;
use warnings;
my $divider= "%\n" # a percentage sign and a newline
# perl scraper1.pl
In fortran, the snippet would be:
open(unit=50,file='ehp3.txt',form='formatted')
do
read(50,*,iostat=eof) line
if (eof /= 0) exit
write(*,*) trim(line)
end do
close(unit=50)
Thanks for your comment.
--
George
It's going to be the year of the sharp elbow and the quick tongue.
George W. Bush
Picture of the Day http://apod.nasa.gov/apod/
.
- Follow-Ups:
- Re: opening a file
- From: Dr.Ruud
- Re: opening a file
- From: cartercc
- Re: opening a file
- From: Ryan McCoskrie
- Re: opening a file
- From: Mirco Wahab
- Re: opening a file
- From: Keith Keller
- Re: opening a file
- From: Jürgen Exner
- Re: opening a file
- Prev by Date: FAQ 3.10 Is there an IDE or Windows Perl Editor?
- Next by Date: Re: opening a file
- Previous by thread: FAQ 3.10 Is there an IDE or Windows Perl Editor?
- Next by thread: Re: opening a file
- Index(es):
Relevant Pages
|