I cannot do split as they are separated by space.
That is precisely why you would use split. eg:
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { my @fields = split; print "Name = $fields[0], Dir = $fields[2]\n"; } __DATA__ FileName FilePath FileDir FileName2 FilePath2 FileDir2 FileName3 FilePath3 FileDir3
In reply to Re: How to grep two strings from a File
by hippo
in thread How to grep two strings from a File
by parthodas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |