Link to home
Start Free TrialLog in
Avatar of xbox360dp
xbox360dp

asked on

Merge files & delete row based on criteria using Perl.

Gurus,

I need some help creating a Perl script to merge 3 files into one, then delete rows based on criteria.

Example:

File1.txt
data|3004|001
data|3005|002
data|3007|003

File2.txt
data|3008|001
data|3009|002
data|3010|003

File3.txt
data|3011|001
data|3012|002
data|3013|003

I want these 3 files merged into one.

Example:

Merge.txt
data|3004|001
data|3005|002
data|3007|003
data|3008|001
data|3009|002
data|3010|003
data|3011|001
data|3012|002
data|3013|003

Once the 3 files have been merged I want to delete rows based on the following criteria:

If column 3 = "001" then delete the entire row.

Final Result:

Merge.txt
data|3005|002
data|3007|003
data|3009|002
data|3010|003
data|3012|002
data|3013|003

Your help is greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial