| | |
seeking help
![]() |
•
•
Join Date: Jun 2009
Posts: 8
Reputation:
Solved Threads: 0
use warnings;
use strict;
open (TEXT_FILE,'C:\Documents and Settings\rnjenga\sawa3.txt');
my ($line, $nextline);
while ($line = <TEXT_FILE>) {
if ($line =~ /FT\s*\Wnote.+\w+:/){
$nextline = <TEXT_FILE> ;
print ("$line $nextline \n");
}
if ($line =~ /FT\s*\Wnote.+none/){
$nextline = <TEXT_FILE> ;
print ("$line $nextline \n");
}
}
close (TEXT_FILE);
I have written the above code to be able to pull the following results out of the text file.
FT /note="go_function: nutrient reservoir activity [goid
FT 0045735]"
FT /note="none"
Now I need you help to be able to write a code that will copy the BOLD string onto the second one.
I have tried too see if I can be able to skip it during reading the file but to no avail.
Kindly assist.
Thanks and God Bless.
use strict;
open (TEXT_FILE,'C:\Documents and Settings\rnjenga\sawa3.txt');
my ($line, $nextline);
while ($line = <TEXT_FILE>) {
if ($line =~ /FT\s*\Wnote.+\w+:/){
$nextline = <TEXT_FILE> ;
print ("$line $nextline \n");
}
if ($line =~ /FT\s*\Wnote.+none/){
$nextline = <TEXT_FILE> ;
print ("$line $nextline \n");
}
}
close (TEXT_FILE);
I have written the above code to be able to pull the following results out of the text file.
FT /note="go_function: nutrient reservoir activity [goid
FT 0045735]"
FT /note="none"
Now I need you help to be able to write a code that will copy the BOLD string onto the second one.
I have tried too see if I can be able to skip it during reading the file but to no avail.
Kindly assist.
Thanks and God Bless.
Have you tried loading the entire file into a variable for searching? You can do this by:
Then run a multi-line regex on the vairable.
Perl Syntax (Toggle Plain Text)
undef($/); open(FILE,"<file.txt"); while(<FILE>){ $allfile=$_; }
Then run a multi-line regex on the vairable.
And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is.
Larry Wall
Larry Wall
![]() |
Similar Threads
- Seeking Talented Graphic Web Deigner (Web Development Job Offers)
- Seeking Merchant Account (Post your Resume)
- Seeking Consultant (Internet Marketing Job Offers)
- IBSoftware Seeking 5 Individuals for Staff & Moderation (Software Development Job Offers)
- Seeking Experienced WD who knows Mambo (Web Development Job Offers)
- Seeking Experienced Logo Designer (Web Development Job Offers)
- Seeking Creative Experienced Banner & Button Designer (Web Development Job Offers)
- Seeking PHP/MySQL Developers for MMORPG (Compensation) (Web Development Job Offers)
- Seeking Experienced, Creative Graphic Web Designer (Web Development Job Offers)
- Seeking Experienced WD with DW Experience (Web Development Job Offers)
Other Threads in the Perl Forum
- Previous Thread: raw data: help
- Next Thread: Perl script syntax errors
| Thread Tools | Search this Thread |





