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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. alexbotea2005

    pattern matching and print filename

    Sorry for that, the first print was part of my trials, Thank you for you help.
  2. alexbotea2005

    pattern matching and print filename

    Hi, Please find bellow the input files: $ cat file1.txt 10% 20% 30% | | | transfered 35168 bytes $ cat file2.txt 10% 20% 30% | | | transfered 435168 bytes $ cat file3.txt 10% 20% 30% | | | transfered 568 bytes $ cat file4.txt 10% 20% 30% | | |...
  3. alexbotea2005

    pattern matching and print filename

    Thank you for your respond, Yes you are right not the pattern gets diplayed, it get displayed the 2'nd row after matching the pattern. The script works fine, I need only a small tweak if it's possible. The filename get's duplicated as follows: file1.txt 0 file1.txt 2'nd row after pattern...
  4. alexbotea2005

    pattern matching and print filename

    awk '/ pattern/ {show[NR+2]++} show[NR]' *.txt The above code search for pattern in several text files and when pattern is found than prints the 2'nd row after. How do I add the filename to be printed in the same line with the pattern? Thanks in advance

Part and Inventory Search

Back
Top