Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the code snippet

awk -v s=$frame_shift '{n += $2}; END{printf("%.0f\n", (n / s))}' <$data/utt2dur


I have a couple of doubts. I know "-v s=$frame_shift" is used to initialise s. And n is the second column of the input file "$data/utt2dur".

But the error is as follows:

awk: fatal: cannot open file `{n += $2}; END{printf("%.0f\n", (n / s))}' for reading (No such file or directory)


1. what exactly is awk fatal error? The search results are too advanced for me. I am only a beginner.
2. Why does it show up in my case?
3. How to get rid of it?

Any help would be appreciated.
Thanks!!

What I have tried:

The final output is empty except for "OKAY:". It is supposed to have a whole column right?
Posted
Comments
Richard MacCutchan 12-May-20 7:27am    
The message is telling you that awk is reading that text as a filename. It is some years since I was writing awk scripts so I cannot offer much other than suggesting your statements are either out of order, or using the wrong quotes. Check the man page for the exact syntax you need.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900