LanceDeeply has asked for the wisdom of the Perl Monks concerning the following question:
this code works:4363^7619082^309839685^309841122^14^18 4363^7619082^309839685^309841122^14^19 4363^7619082^309839685^309841122^14^20 4363^7619082^309839685^309841122^26^25 4363^7619082^309839685^309841122^26^26 4363^7619082^309839685^309841122^14^52 4363^7619082^309839685^309841122^14^51 4363^7619082^309839685^309841122^23^21
but i want to use -F like so:perl -ne '@ar = split /\^/; $key="$ar[0],$ar[1],$ar[2],$ar[3]\n"; pri +nt $key if ( ! $seen{$key} ++ );' datafile
but it wont split!perl -naF^ -e '$key="$F[0],$F[1],$F[2],$F[3]\n"; print $key if ( ! $se +en{$key} ++ );' datafile or -F/^/ -F/\^/ -F"^" -F'^'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl one liner with -F special char
by cog (Parson) on Apr 21, 2005 at 16:58 UTC | |
by LanceDeeply (Chaplain) on Apr 21, 2005 at 18:29 UTC | |
|
Re: perl one liner with -F special char
by sk (Curate) on Apr 21, 2005 at 17:08 UTC | |
|
Re: perl one liner with -F special char
by ikegami (Patriarch) on Apr 21, 2005 at 17:02 UTC | |
|
Re: perl one liner with -F special char
by deibyz (Hermit) on Apr 21, 2005 at 17:20 UTC |