You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the input files sample.txt, secrets.txt, addr.txt and table.txt, display only the names of files that contain at or fun in the third field. Assume space as the field separator.
Use a file which has multiple records containing at or fun in the third field, so that if you forget to use nextfile, the output is not matched due to a filename being printed more than once.
I would also add to the problem specification that the file name is expected to be printed once per file (if other criteria met).
The text was updated successfully, but these errors were encountered:
It's also numerated as exercise 2) in https://learnbyexample.github.io/learn_gnuawk/multiple-file-input.html
The expected solution is:
but it also works without
nextfile
.Suggestion
Use a file which has multiple records containing
at
orfun
in the third field, so that if you forget to usenextfile
, the output is not matched due to a filename being printed more than once.I would also add to the problem specification that the file name is expected to be printed once per file (if other criteria met).
The text was updated successfully, but these errors were encountered: