macubergeek
IS-IT--Management
I have a file which contains a series of strings, with a comma seperated value like 0 or 1 or enabled, disabled.
1. I am loading this file into an array like so:
open(STUFF, "stuff.txt") || die("Could not open file!");
my @master=<STUFF>;
close <STUFF>;
2. stuff.txt has the following text:
"Hi how are you?",0
"I am fine.",1
"No yer not.",Enabled
"Yes I am.",Disabled
3. Now I want to grep for each line concatenated with the value in the file raw.txt.
my $string = ""
my $value = ""
foreach $line (@master) {
$line = split(/,/, $line);
$found = grep $string.$value raw.txt
As you can probably see, it's the last step I'm having problems with. Can someone point me in the right direction here?
1. I am loading this file into an array like so:
open(STUFF, "stuff.txt") || die("Could not open file!");
my @master=<STUFF>;
close <STUFF>;
2. stuff.txt has the following text:
"Hi how are you?",0
"I am fine.",1
"No yer not.",Enabled
"Yes I am.",Disabled
3. Now I want to grep for each line concatenated with the value in the file raw.txt.
my $string = ""
my $value = ""
foreach $line (@master) {
$line = split(/,/, $line);
$found = grep $string.$value raw.txt
As you can probably see, it's the last step I'm having problems with. Can someone point me in the right direction here?