Need to write a shell script

Hi,
I need to write a statement which will read a data from a specific line based on condition and then read related lines to delete.
For example:

|T20150322
100930290
208940000
598000080
700000000
930000202
100000000
.T56789
|T20150322
0100000000
0200000000
0500000000
9000000000
1000000000
.T97394[This user id]

Here one set of record for a user id starts from header |T and ends at .T . If position 2-10 is 0 then script should remove the set from the file. Here for user id 97394 position 2-10 is all 0. So this set should eb deleted from the file.

Need your help plz. I need to create a shell script for this.

Other than the fact that you have eliminated spaces in your |T and .T "records" and now have variable length records in the lines between the ?T "records", this is extremely similar to your last thread: Extract batch based on condition.

Why can't you modify one of the perl or shell scripts you were given in that thread to process your modified input file format? If you tried to do that and failed, show us what you tried and explain what you were unable to get it to do.

If you just changed your input file format and decided that wanted to use the UNIX & Linux Forums as your unpaid programming staff instead of learning how to use the tools yourself; that isn't what we volunteers are here for.

Show some appreciation for the help volunteers here have provided. Show us that you are learning from the suggestions we have made. Show us that you are making an effort to learn from the suggestions we have provided. If you see suggestions that work for you, but you don't understand how they work; ask for an explanation of how the code works. We are happy to help you learn; we are not happy doing your work for you.

1 Like