TBH I am an absolute novice, when it comes to scripting; I do have an idea of the basic commands...
Here is my problem;
I have a flatfile 'A' containing a single column with multiple rows. I have to create a script which will use 'A' as input and then output a string in in the format ('row1','row2','row3')
eg:
file A:
Y781
TGH8
UIP9
output:
('Y781','TGH8','UIP9')
NB: No, I'm not a college student asking for help on his coding assignment!
$ awk 'BEGIN {printf("(");}
> {printf"("'%s'," ) }
> END {printf(")\n") } '
awk: The string ) } cannot contain a newline character.
The source line is 2.
The error context is
{printf"("%s," ) } >>>
<<<
syntax error The source line is 3.
awk: The statement cannot be correctly parsed.
The source line is 3.
awk: There is a missing } character.
and the argument of the printf is missing after the format string.
Another problem is that there will be an unwanted comma before the ) in the resulting output.