V
vorticitywolfe
Hello,
I have looked all over trying to find an example of how to grab
certain parts of a text file while ignoring others in the same line.
the file:
*************test.txt*************************
CREATED AT: Wed-June6-17:50 2007
NUM OBS: 1440
Values of two numbers:30.0/45.0 More text
that can be disregarded.
***********************************************
Here is what I want to grab from it:
**************output************************
CREATED AT: Wed-June6-17:50 2007
VALUE: 30.0/45.0
**********************************************
Of course, the file is much larger than this, but I just want the
general syntax of how to accomplish this.
I've just started to use reg ex's, so bear with me...here is what I
have thusfar:
while(<file>){
if ($_=~ /(\d+)/)
{
print $_;
}
}
Thanks for your help!
Jonathan
I have looked all over trying to find an example of how to grab
certain parts of a text file while ignoring others in the same line.
the file:
*************test.txt*************************
CREATED AT: Wed-June6-17:50 2007
NUM OBS: 1440
Values of two numbers:30.0/45.0 More text
that can be disregarded.
***********************************************
Here is what I want to grab from it:
**************output************************
CREATED AT: Wed-June6-17:50 2007
VALUE: 30.0/45.0
**********************************************
Of course, the file is much larger than this, but I just want the
general syntax of how to accomplish this.
I've just started to use reg ex's, so bear with me...here is what I
have thusfar:
while(<file>){
if ($_=~ /(\d+)/)
{
print $_;
}
}
Thanks for your help!
Jonathan