在命令下输入
gawk -f readtxt.awk <要读取的文件名>
readtxt.awk的内容如下:
BEGIN{
FS=OFS=""
}
# This is the main script
{
for(i=1;i<=NF;i++){
printf("%s",$i);
system("echo ok>nul")
}
printf "\n"
}
Enter at the command line
gawk -f readtxt.awk <filename to read>
The content of readtxt.awk is as follows:
BEGIN{
FS=OFS=""
}
# This is the main script
{
for(i=1;i<=NF;i++){
printf("%s",$i);
system("echo ok>nul")
}
printf "\n"
}