I am trying to read a parameter from the URL, i am able to read for single line but i don't know how to loop in awk, can someone help?
i have file with 1000+ entries like
http://projectreporter.nih.gov/project_info_details.cfm?aid=7714687&icde=0
http://projectreporter.nih.gov/project_info_description.cfm?aid=7896503&icde=0
http://projectreporter.nih.gov/project_info_details.cfm?aid=7895320&icde=0
http://projectreporter.nih.gov/project_info_details.cfm?aid=2675186&icde=9195637
i am trying to only retrive "aid=xxxxxxx", i used the following command to do it and i get the "aid" for the last line
awk '{match($0,"aid=([^ &]+)",a)}END{print a[1]}' file1.txt > outputFile.txt
how to do the same in a loop so i can get all the occurrence? any help would be appreciated