Previously-functional gawk script now failing to execute - PLEASE HELP!!!
Wed Sep 15 23:49:21 GMT 2021
On 9/15/21, Bryan VanSchouwen via Cygwin wrote:
> I just tried executing an old, previously-functional awk script using a
> version of gawk that I had downloaded last year, and a command of the
> following format (as recommended in a previous communication with the
> Cygwin mailing list):
> gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
> but this time, the script failed to execute!!
The data file you attached doesn't have "\r\n" line endings:
$ file rpcg_FF_filtrd.txt
rpcg_FF_filtrd.txt: ASCII text
compare with one that does:
$ file test.txt
test.txt: ASCII text, with CRLF line terminators
<.. snip ..>
> What the heck is going on with this software, and is there a way to fix
I don't use RS and start my awk scripts off with
sub("\r$", "", $0) # fix any \r\n line endings
so my scripts work with either flavor of line endings.
If you don't want to change your script try changing your input
unix2dos <your text files>
More information about the Cygwin