Dear All, I'm not a very strong perl programmer but need to grep data from a large file where I have multiple outputs. Used the following example in ggrep to get my correct output:
cat file.large | ggrep country | ggrep city1 | ggrep street1 | ggrep -v name1Horrilbe, I know.... but need to get the value of name2 only as output. File text looks sort of:
Country City Street1 number1 name1 Country City1 Street1 number1 name2 Country City1 Street1 number2 name3 Country City1 Street2 number1 name4 Country City1 Street2 number1 name5
The output of the info in the 2nd line and going into $myoutput1 as:
Country City Street1 number1 name2The last output required is "$thenameis" will just be name2 from the file. But this can be done with
$thenameis = $myoutput1[4]; ##This should be correct..PS this grep will be in a foreach loop. Any ideas.. thank you
In reply to Need to multi grep and grep exclude in perl. by Frits
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |