Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

awk command in ExecuteStreamCommand

avatar
Rising Star

Hi!

I need to execute following awk command on flow file via ExecuteStreamCommand processor

awk -F"," '{OFS=","; $4=substr($4,1,19); print $0}'

When run it throws an error: Executable command awk ended in an error: awk: fatal: cannot open file `print $0}" for reading (No such file or directory).


Flow file comes from ListFTP -> FetchFTP -> ExecuteStreamCommand


Could you please help to solve this issue!!

Thank you!!


When running the same awk command on server it works fine:

awk -F"," '{OFS=","; $4=substr($4,1,19); print $0}' myfile.csv



ecs.png
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Gulshan Agivetova

At least one problem i see in your config which is causing the following error:

Executable command awk ended in an error: awk: fatal: cannot open file `print $0}" for reading (No such file or directory



Thsis is because in your . "Command Arguments" you are using semicolon. And in "ExecuteStreamCommand" the "Argument Delimiter" is also set to ";" (which is default delimiter)

May be you can try changing the "Argument Delimiter" to something else then check if you are still getting the same error or not?






View solution in original post

1 REPLY 1

avatar
Master Mentor

@Gulshan Agivetova

At least one problem i see in your config which is causing the following error:

Executable command awk ended in an error: awk: fatal: cannot open file `print $0}" for reading (No such file or directory



Thsis is because in your . "Command Arguments" you are using semicolon. And in "ExecuteStreamCommand" the "Argument Delimiter" is also set to ";" (which is default delimiter)

May be you can try changing the "Argument Delimiter" to something else then check if you are still getting the same error or not?