title: read parameter from a url
body: <p>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?</p>
  
  <p>i have file with 1000+ entries like </p>
  
  <pre><code>http://projectreporter.nih.gov/project_info_details.cfm?aid=7714687&amp;icde=0
  http://projectreporter.nih.gov/project_info_description.cfm?aid=7896503&amp;icde=0
  http://projectreporter.nih.gov/project_info_details.cfm?aid=7895320&amp;icde=0
  http://projectreporter.nih.gov/project_info_details.cfm?aid=2675186&amp;icde=9195637
  </code></pre>
  
  <p>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</p>
  
  <pre><code>awk '{match($0,"aid=([^ &amp;]+)",a)}END{print a[1]}' file1.txt &gt; outputFile.txt
  </code></pre>
  
  <p>how to do the same in a loop so i can get all the occurrence? 
  any help would be appreciated </p>