AWK: Skip to next file

1.6k Views Asked by At

I have many data files to process but it isn’t necessary to process every record in every file.Is there a way to instruct awk to stop precessing the current file and skip to the next file?

1

There are 1 best solutions below

1
karakfa On

you can use nextfile statement, it's supported in many awks (except perhaps Solaris)

$ awk '/4/{nextfile} 1' <(seq 10) <(seq 10)
1
2
3
1
2
3