Help for a newby

I am new to using nawk. When I put the following line in script file test1.awk
I get the results:

{ print NR, length($0),NF}

>nawk -f test1.awk head.txt

1 63 5
2 2622 188
3 2166 155
4 3192 228
5 2679 192
.....

but if I modify the test1.awk file to look like this:
BEGIN {FS = ","}
{ print NR, length($0),NF}

when if do:
>nawk -f test1.awk head.txt

I get

nawk: syntax error at source line 1
context is
<<< BEGIN {FS = >>> ","}
nawk: bailing out at source line 1

I have tried many combinations o single quotes, no quotes with the same result.

Any Idea Why???

works just fine on Solaris.
make sure you don't have any control characters in the awk file.

I was using Notepad and accessing the directory through a mapped drive in explorer and Bingo, you were right! there was a ^M character at the end of the first line. As soon as I removed it. It worked

Thanks!

Now back to the learning phase!!