You are reading a single comment by @cyclotron3k and its replies. Click here to read the full conversation.
  • Just wanted to join party:

    grep '' * --recursive -H --max-count=5 --include '*.csv'
    

    Grep can search recursively, and prepend the filename to the matched lines, and limit the number of matches from each file. Combine all that, and you get a solution, only problem is that the filename is followed by a colon:

    subdir/test2.csv:1
    subdir/test2.csv:
    subdir/test2.csv:2
    subdir/test2.csv:3
    subdir/test2.csv:4
    test1.csv:1
    test1.csv:2
    test1.csv:3
    

    so you'd need to replace that...

    grep '' * -r -H -m5 --include '*.csv' | sed 's/:/,/'
    
About

Avatar for cyclotron3k @cyclotron3k started