mrimagepueblo
Programmer
I have a tab delimited file where one field has multiple entries seperated by a pipe |.
ie.
field1 field2 field3 123|239|234| field5
what I want to do is match on the |239 and delete that line out of the file.
I am running a bash shell script and have tried this line and thought it would work.
perl -pi -e 's/\|239/d' listings-residential.txt
but I get an error:
Substitution replacement not terminated at -e line 1.
I also tried
perl -pi -e 's/|239/d' listings-residential.txt
and get the same error.
I even get the same error with
perl -pi -e 's/239/d' listings-residential.txt
So is the /d' not valid this way?
What am I missing? Would an awk statement be better since I know that if the match occurs it's in field 4 of the data file? It's possible that |239 could occur in other fields.
ie.
field1 field2 field3 123|239|234| field5
what I want to do is match on the |239 and delete that line out of the file.
I am running a bash shell script and have tried this line and thought it would work.
perl -pi -e 's/\|239/d' listings-residential.txt
but I get an error:
Substitution replacement not terminated at -e line 1.
I also tried
perl -pi -e 's/|239/d' listings-residential.txt
and get the same error.
I even get the same error with
perl -pi -e 's/239/d' listings-residential.txt
So is the /d' not valid this way?
What am I missing? Would an awk statement be better since I know that if the match occurs it's in field 4 of the data file? It's possible that |239 could occur in other fields.