G
geeknc
I have a file that contains 5 elements per line each seperated by white
space, however the 4th element is surrounded by quotes.
Each line in a file looks like this:
ItemA ItemB 1.1.1.1.1 "xxx xx xxxxxx" ItemD
I was hoping to do something like this....
($a,$b,$c,$d,$e) = split(/split on white space or "...."/, $string);
and end up with....
$a = "ItemA";
$b = "ItemB";
$c = "1.1.1.1.1";
$d = "xxx xx xxxxxx";
$e = "ItemD";
I have tried multiple delimiters, but nothing seems to return 5
elements. Thank you, in advance, for any help you can offer.
space, however the 4th element is surrounded by quotes.
Each line in a file looks like this:
ItemA ItemB 1.1.1.1.1 "xxx xx xxxxxx" ItemD
I was hoping to do something like this....
($a,$b,$c,$d,$e) = split(/split on white space or "...."/, $string);
and end up with....
$a = "ItemA";
$b = "ItemB";
$c = "1.1.1.1.1";
$d = "xxx xx xxxxxx";
$e = "ItemD";
I have tried multiple delimiters, but nothing seems to return 5
elements. Thank you, in advance, for any help you can offer.