Script needed

Here is a file that I want to run a script to do the following

File Content:

0883318739,13010,A,300,abcde
0880123456,5433,C,200,xcvfe
0882344242,4233,N,204,ghfsa

Script to be get:

Try to have a script that can match all the below criteria
1st field range from 08801xxxxx to 0882xxxxxx
2nd field over 3000
3rd field A or N
4th field starting with 2
5th location_id contains letter �a�

Thanks

but you didn't mention what to do with the row that does or doesn't matches your listed criteria

print only rows that match crieteria

The way you give a blatant list of requirements makes me strongly suspect this his homework...

What have you tried?

Its the 1st time for me scripting all these commands, so I do search every requirement then write it on its own, I didn't know that I can put && after each line so it goes to the next one

Thanks alot for your help now I ll try more complex commands

I agree.. this is homework and should be posted in the h/w forum under h/w rules.

1 Like

When two mods and an admin agree, I'm pushed beyond mere suspicion.

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.