Re: Parsing a Text File using regex

2011-08-06 Thread Rob Dixon
On 06/08/2011 15:14, Emeka wrote: John, Thanks for making things pretty simple for mere mortals .. Hi Emeka chomp( my $raw_file = glob "@ARGV" ); I am of the view that glob sub is used for as tree (that is to get all the files in a folder and all its sub-folders. From the above, it see

Re: Parsing a Text File using regex

2011-08-06 Thread Emeka
John, Thanks for making things pretty simple for mere mortals .. >> > chomp( my $raw_file = glob "@ARGV" ); > I am of the view that glob sub is used for as tree (that is to get all the files in a folder and all its sub-folders. From the above, it seems like it could be used for something else.

Re: Parsing a Text File using regex

2011-08-04 Thread Uri Guttman
> "ta" == timothy adigun <2teezp...@gmail.com> writes: ta> I believe you know that in Perl there are more than one way to do ta> it! i.e solve a problem. And that one way is no better than the ta> other, it only depend on what the programmer preferred to use, as ta> long as the syntax

Re: Parsing a Text File using regex

2011-08-04 Thread timothy adigun
Hi John, I believe you know that in Perl there are more than one way to do it! i.e solve a problem. And that one way is no better than the other, it only depend on what the programmer preferred to use, as long as the syntax are correct. Secondly, most of your why would have been answered, if only y

Re: Parsing a Text File using regex

2011-08-04 Thread John W. Krahn
timothy adigun wrote: Hi Ryan, Try the the code below, it should help. === #!/usr/bin/perl -w use strict; my $ln=""; my ($yr,$cat,$win)=("","",""); my $filename="New_output.txt"; chomp(my $raw_file=<@ARGV>); That is the same as saying: chomp( my $raw_file = glob

Re: Parsing a Text File using regex

2011-08-04 Thread Ryan
Timothy, That worked like a charm. Thank you so much for the help. -Ryan On Thu, Aug 4, 2011 at 4:41 AM, timothy adigun <2teezp...@gmail.com> wrote: > Hi Ryan, > Try the the code below, it should help. > > === > > #!/usr/bin/perl -w > use strict; > > my $ln=""; > my ($yr,

Re: Parsing a Text File using regex

2011-08-04 Thread timothy adigun
Hi Ryan, Try the the code below, it should help. === #!/usr/bin/perl -w use strict; my $ln=""; my ($yr,$cat,$win)=("","",""); my $filename="New_output.txt"; chomp(my $raw_file=<@ARGV>); open READFILE,"<","$raw_file" or die "can't open $!"; open OUTPUTFILE,">","$filenam

Parsing a Text File using regex

2011-08-03 Thread Ryan Lagola
Hello, I have been scratching my head on this problem and was wondering if someone can help me out. Basically I need to take a raw list of data (a snippet of it is below my email) and create another file with the information formatted in the following format: "Date: Category: Winner." The example