Re: reading a file

2006-10-20 Thread Anshul Saxena
The old 'lsil.com' email address will stop working after Jan 15, > 2007. Please update your address book and distribution lists > accordingly. Thank you. > > -Original Message- > From: Gerald Host [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 19, 2006 3:35 PM >

RE: reading a file

2006-10-20 Thread Helliwell, Kim
e old 'lsil.com' email address will stop working after Jan 15, 2007. Please update your address book and distribution lists accordingly. Thank you. -Original Message- From: Gerald Host [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 3:35 PM To: Perl List Subject: reading a file

RE: reading a file

2006-10-20 Thread Helliwell, Kim
o: Perl List Subject: reading a file I'm trying to read a text file line-by-line. open IN, shift; my @lines=split("\n",); foreach my $line (@lines) { print OUT "QQQ $line QQQ\n";

Re: reading a file

2006-10-19 Thread xavier mas
A Divendres 20 Octubre 2006 00:34, Gerald Host va escriure: > I'm trying to read a text file line-by-line. > > open IN, shift; > my @lines=split("\n",); > foreach my $line (@lines) { > print OUT "QQQ $line QQQ\n

Re: reading a file

2006-10-19 Thread Jenda Krynicky
From: "Gerald Host" <[EMAIL PROTECTED]> > I'm trying to read a text file line-by-line. > > open IN, shift; > my @lines=split("\n",); Did you ever read the docs??? my @lines=; The <> operator returns the list of lines in the file if called in the

Re: reading a file

2006-10-19 Thread Gerald Host
date your address book and distribution lists accordingly. Thank you. -Original Message- From: Gerald Host [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 3:35 PM To: Perl List Subject: reading a file I'm trying to read a text file line-by-line. open IN, shift

reading a file

2006-10-19 Thread Gerald Host
I'm trying to read a text file line-by-line. open IN, shift; my @lines=split("\n",); foreach my $line (@lines) { print OUT "QQQ $line QQQ\n"; } The problem is that it always gives me th

Re: Reading a file

2003-03-04 Thread John W. Krahn
Nick Drage wrote: > > On Tue, Mar 04, 2003 at 11:24:55AM -, Rob Dixon wrote: > > > > @rgstr=; > > > > This puts the <> operator into list context, so it will read > > all of the file, placing separate records into consecutive > > elements of the array. If this is what you want to do, then > >

Re: Reading a file

2003-03-04 Thread Nick Drage
On Tue, Mar 04, 2003 at 11:24:55AM -, Rob Dixon wrote: > > @rgstr=; > > This puts the <> operator into list context, so it will read > all of the file, placing separate records into consecutive > elements of the array. If this is what you want to do, then > you have finished with the file a

Re: Reading a file

2003-03-04 Thread Rob Dixon
Hi Diego Diego Aguirre wrote: > Hello, > I have just learned opening and reading a file, with > > open (HoyIn,"File.txt"); Filehandles are traditionally all upper case, as: open (HOYIN, "File.txt"); > @rgstr=; This puts the <> operator into list

Re: Reading a file

2003-03-03 Thread John W. Krahn
Diego Aguirre wrote: > > Hello, Hello, > I have just learned opening and reading a file, with > > open (HoyIn,"File.txt"); What would happen if for some reason the file could not be opened? You should ALWAYS verify that the file opened correctly. > @rgst

Reading a file

2003-03-03 Thread Diego Aguirre
Hello, I have just learned opening and reading a file, with open (HoyIn,"File.txt"); @rgstr=; foreach $linea (@rgstr) { print $linea ; } close (HoyIn); I want read the file from -lets say- the fifth line on. Any help, pls? Forhp Shiottr J.

RE: Problem reading a file and passing a variable

2002-05-31 Thread Chas Owens
my $get_case_text = $dbh->prepare(" > SELECT > a.sr_num sr_num, > a.sr_title sr_title, > a.sr_stat_id sr_stst_id > FROM > s_srv_req

RE: Problem reading a file and passing a variable

2002-05-30 Thread Lance Prais
sr_stst_id FROM s_srv_req a WHERE sr_num = ?"); $get_case_text->execute($sr_num) || $dbh->errstr; ($sr_num,$sr_title,$sr_stat_id) = $get_case_text->fetchrow_array(); $get_case_text->finish; } ETC..

RE: Problem reading a file and passing a variable

2002-05-30 Thread Chas Owens
On Thu, 2002-05-30 at 14:29, Lance Prais wrote: > Janek, > I tried that originally with the same results. I am perplexed to why this > is happening, anyone have any ideas? > > > Thanks > Lance > Try this. I have no idea why it would work and the other wouldn't, but it is worth a try.

RE: Problem reading a file and passing a variable

2002-05-30 Thread Lance Prais
reading a file and passing a variable Lance Prais wrote at Thu, 30 May 2002 01:47:34 +0200: Perhaps you missed to chomp th $ln. So $ln = "1-294613112\n" what is perhaps not what you wanted. > This is the most bizarre thing I have ever seen. I am using the following code: There is &g

RE: Problem reading a file and passing a variable

2002-05-30 Thread Janek Schleicher
Lance Prais wrote at Thu, 30 May 2002 01:47:34 +0200: Perhaps you missed to chomp th $ln. So $ln = "1-294613112\n" what is perhaps not what you wanted. > This is the most bizarre thing I have ever seen. I am using the following code: >There is > absolutely no reason why this should not return

RE: Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
inish; print "--> SR(bulk): $case->{sr_num}\n"; print "--> User Id(name): $case->{sr_title}\n"; $line++; } close(BULK); $dbh->disconnect; -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED]] Sent: We

RE: Problem reading a file and passing a variable

2002-05-29 Thread Chas Owens
t; Thanks > Lance > > -Original Message- > From: Chas Owens [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 29, 2002 4:11 PM > To: Lance Prais > Cc: Perl > Subject: RE: Problem reading a file and passing a variable > > On Wed, 2002-05-29 at 17:05, Lance Pra

RE: Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
Wednesday, May 29, 2002 4:11 PM To: Lance Prais Cc: Perl Subject: RE: Problem reading a file and passing a variable On Wed, 2002-05-29 at 17:05, Lance Prais wrote: > [Chas], > Thank you, you made me realize the value of indention like never before. > In the past I used the "=?&quo

RE: Problem reading a file and passing a variable

2002-05-29 Thread Chas Owens
On Wed, 2002-05-29 at 17:05, Lance Prais wrote: > [Chas], > Thank you, you made me realize the value of indention like never before. > In the past I used the "=?" to return results form the query but in this > case when I used in and run this script it does not error out but instead > the query

Re: Problem reading a file and passing a variable

2002-05-29 Thread Chas Owens
On Wed, 2002-05-29 at 16:13, Lance Prais wrote: > I am m using the following code to read from a .txt file. I am running into > a problem that I am not sure why it is happening. > The problem is when I run this script the SQL is not reading the variable. > I am testing to make sure the .txt file

Re: Problem reading a file and passing a variable

2002-05-29 Thread Felix Geerinckx
on Wed, 29 May 2002 20:13:13 GMT, Lance Prais wrote: There is no need to post your message three times in less than 10 minutes. > while( my $ln = ) > { > chomp($ln); > #use the items of the > my $get_case_text = $dbh->prepare("SELECT a.sr_num ,b.name ,b.loc > ,a.sr_title,f.mid_name ,

Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
I am m using the following code to read from a .txt file. I am running into a problem that I am not sure why it is happening. The problem is when I run this script the SQL is not reading the variable. I am testing to make sure the .txt file contains data and it does. I get the following error: D

Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
I am m using the following code to read from a .txt file. I am running into a problem that I am not sure why it is happening. The problem is when I run this script the SQL is not reading the variable. I am testing to make sure the .txt file contains data and it does. I get the following error: D

Problem reading a file and passing a variable

2002-05-29 Thread Lance Prais
I am m using the following code to read from a .txt file. I am running into a problem that I am not sure why it is happening. The problem is when I run this script the SQL is not reading the variable. I am testing to make sure the .txt file contains data and it does. I get the following error: D

reading a file

2002-03-21 Thread sriram rachakonda
can anybody help me out on how to read in the text files say xyz.txt which is in a path /mnt/diskf/stu/tmp/sis into a hash ? anyone please **Sriram.R** **Sriram.R** _ Chat with friends online, try MSN Messenger: http://me

Re: reading a file line by line

2002-03-04 Thread Hernan Freschi
There's a simpler way, if you specify the file from the command line (as in script.pl file) you can do while (<>) { last if /search test/; #do something } in fact, you can make a cat-like script like this: while (<>) { print; } <> is the diamond operator, and it's the filehandle fo

Re: reading a file line by line

2002-02-27 Thread John W. Krahn
Jon Serra wrote: > > Greetings, I am trying to read a text file into a scalar variable line by line > until EOF or a search test if fullfilled. I have been reading files in like > this: > > chomp (@line = `cat filename`); > > I do not want to do this beacuse my file is quite large, and there

RE: reading a file line by line

2002-02-27 Thread Lyon, Justin
#x27;s it. Somebody correct me if I'm wrong. -Original Message- From: Jon Serra [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:58 AM To: [EMAIL PROTECTED] Subject: reading a file line by line Greetings, I am trying to read a text file into a scalar variable lin

Re: reading a file line by line

2002-02-27 Thread Brett W. McCoy
On Wed, 27 Feb 2002, Jon Serra wrote: > Greetings, I am trying to read a text file into a scalar variable line by line > until EOF or a search test if fullfilled. I have been reading files in like > this: > > chomp (@line = `cat filename`); > > I do not want to do this beacuse my file is quite

reading a file line by line

2002-02-27 Thread Jon Serra
Greetings, I am trying to read a text file into a scalar variable line by line until EOF or a search test if fullfilled. I have been reading files in like this: chomp (@line = `cat filename`); I do not want to do this beacuse my file is quite large, and there is no reason to hog the memory

Re: HELP - finding a float while reading a file

2002-01-04 Thread Sudarsan Raghavan
Nestor Florez wrote: > Hi there, > > I am trying to read a file and find the last numeric value in the line read. > example: > 123 45 -23 56 <-3.45 > 145 555 112 -12.0 -2.55 > > all of the values are separated by a space and I am looking for the last > value. > I tried If you know that the valu

RE: HELP - finding a float while reading a file

2002-01-04 Thread John Edwards
tch the end of the string, so the match found must appear at the end of the string of data. This is probably where you were going wrong before. HTH John -Original Message- From: Nestor Florez [mailto:[EMAIL PROTECTED]] Sent: 04 January 2002 02:26 To: [EMAIL PROTECTED] Subject: HELP - fi

HELP - finding a float while reading a file

2002-01-04 Thread Nestor Florez
Hi there, I am trying to read a file and find the last numeric value in the line read. example: 123 45 -23 56 <-3.45 145 555 112 -12.0 -2.55 all of the values are separated by a space and I am looking for the last value. I tried $_ = s/[-][0-9].+$/$1/; $number = $1; The problem is that, not a

Re: Reading A File From A Remote Host Using Sockets.

2001-08-29 Thread Brett W. McCoy
On Wed, 29 Aug 2001, Ken Hammer wrote: > I'm attempting to write a perl script, that will > read a file from a remote host. It must be done > through SSL. I was looking into the possibility > of using sockets (IO::Socket::INET), or some > such animal to accomplish this task. > First, is it poss

Reading A File From A Remote Host Using Sockets.

2001-08-29 Thread Ken Hammer
Hi All, I'm attempting to write a perl script, that will read a file from a remote host. It must be done through SSL. I was looking into the possibility of using sockets (IO::Socket::INET), or some such animal to accomplish this task. First, is it possible to connect using sockets to a SSL por