我希望将输出文件存储在其他文件夹中。 这是我的代码:
BEGIN{
RS = "\n"
originalFile= ARGV[1]
name="_MySQl.sql"
file=substr(originalFile,1,length(originalFile)-4)
path = "C:\\Users\\sanjanaj\\Desktop\\CheckScript\\ConvertedDDL\\"
filename = path file name
}
{
//logic
print $record > filename
}
然后当我尝试在Windows CMD上运行它时,我得到了这个。
C:\Users\sanjanaj\Desktop\CheckScript>awk -f test.awk REF_CALENDAR.sql
awk: test.awk:24: (FILENAME=REF_CALENDAR.sql FNR=4) fatal: can't redirect to `C:\Users\sanjanaj\Desktop\CheckScript\ConvertedDDL\REF_CALENDAR_MySQl.sql' (No such file or directory)