Hi, I'm just starting to write awk scripts. In the code below I'm trying to create a fixed delimeter file so I can load it into a MS db using dts. It doesn't seem to recogonize the fixed width or field separator. Does anyone have any ideas how I can separate these fields? Thanks.
BEGIN {FS="\|"
printf("%-18s %-10s %-20s %-3s %-50s %-50s\n",
"company_id","start_dt", "amt_outsd", "co_cd", "Filename", "Filedate")
}
NR==1 {VAR1=$0}
NR>=3{printf("%-18s %-10s %-20d %-3s %-50s %-50s\n",$1,$2,$3,$4,ARGV[1],VAR1)
}
BEGIN {FS="\|"
printf("%-18s %-10s %-20s %-3s %-50s %-50s\n",
"company_id","start_dt", "amt_outsd", "co_cd", "Filename", "Filedate")
}
NR==1 {VAR1=$0}
NR>=3{printf("%-18s %-10s %-20d %-3s %-50s %-50s\n",$1,$2,$3,$4,ARGV[1],VAR1)
}