Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ability to scan over and over same input file in AWK?

Status
Not open for further replies.

ZorbasE

Technical User
Nov 2, 2006
2
GR
Hi again, i posted about printing previous lines but that wont solve any problems.. so i understand my real question is if AWK is capable of searching for different patterns in a text by running once a programm. These patterns preexist in the text file, occur while the program runs and could of cource match lines that have been already tested by AWK for a previous pattern. How can i reach them again for a new pattern that occurs? How can i tell AWK to restart searching the textfile?


I actually have a text that describes a circuit in verilog,
i search for certain inputs, use them to find where in the circuit they are outputs, then take the component that has those outputs and follow its inputs back to the main circuit inputs by the same way. I guess the only way to do that is by rescanning the whole text each time i find a pattern(input or output) i want, just like i would do "by hand".

Is that pls possible with AWK, any thoughts/help?

thx in advance

Yannis
 
You may consider using associative array(s) and recursive function call(s).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top