Fischer has asked for the wisdom of the Perl Monks concerning the following question:
I want to make it a perl script file.pl So the program should work like so, but I'm not sure how to write it properly in perlperl -i.bak -F, -ane ' if ($F[0]+1 == $F[1] and $F[1]+1 == $F[2]) {warn "row $.: $_"} els +e {print} ' file.csv 2>file.log
so you see it's pretty basic, I want use perl, not python for reasons outside the scope of my questionfor line in file: for i in range(1,4): if ($F[0]+ i == $F[1] and $F[1]+i == $F[2]): remove line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Searching for Patterns in CSV
by davido (Cardinal) on Jun 28, 2015 at 14:20 UTC | |
|
Re: Searching for Patterns in CSV
by roboticus (Chancellor) on Jun 28, 2015 at 14:18 UTC | |
|
Re: Searching for Patterns in CSV
by Laurent_R (Canon) on Jun 28, 2015 at 15:01 UTC | |
|
Re: Searching for Patterns in CSV
by 1nickt (Canon) on Jun 28, 2015 at 14:41 UTC | |
|
Re: Searching for Patterns in CSV
by Tux (Canon) on Jun 29, 2015 at 05:57 UTC | |
|
Re: Searching for Patterns in CSV
by stevieb (Canon) on Jun 28, 2015 at 15:09 UTC |