in reply to perl Regex
If this is the | seperated equivalent of a CSV file, you could do something like this:
use strict; use warnings; open("FILE", "< ./file") or die ("Can't open the file: $!"); while (my $line = <FILE>) { my ($var1, $var2, $domain, $domain_name, $var9, $var6) = split '\|', $line; # do whatever with each value here... }
Or you could use split to split on "DOMAIN\|" and then split on pipes, and only grab the domain by shifting out the resulting array. Btw, I escaped the pipe character because it's a special char in regular expressions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: perl Regex
by Anonymous Monk on Feb 11, 2004 at 23:23 UTC | |
by borisz (Canon) on Feb 11, 2004 at 23:27 UTC | |
by borisz (Canon) on Feb 11, 2004 at 23:30 UTC | |
by Vautrin (Hermit) on Feb 11, 2004 at 23:31 UTC |