bash-2.05$ awk -F"," '{ print > $12 ; close($12)}' file.txt
awk: too many output files 10
record number 11
bash-2.05$ awk -F"," '{ print > $12 }' file.txt
awk: too many output files 10
record number 11
---------- Post updated at 06:52 AM ---------- Previous update was at 06:51 AM ----------
---------- Post updated at 06:53 AM ---------- Previous update was at 06:52 AM ----------
thnx shahul but i got this result
nawk: syntax error at source line 1
context is
{for(X=1;X<100;X++){if($12~X) >>> print>X. <<< txt}}
nawk: illegal statement at source line 1
@ pamu thnx and do u mean
its the 12th column at my file i ve tried
awk -F, '{ print > $NF".txt" }' file
awk: too many output files 10
record number 14
awk -F, '{ print > $12".txt" }' file
awk: too many output files 10
record number 78
have just tried something and below are the results...
nawk -F, '{for(x=1;x<100;x++) {if($NF~x) {{x=x".txt"}{print > x}}}}' input.txt
-rw-rw-rw- 1 user user 11 Feb 26 12:28 4.txt
-rw-rw-rw- 1 user user 11 Feb 26 12:28 3.txt
-rw-rw-rw- 1 user user 22 Feb 26 12:28 2.txt
-rw-rw-rw- 1 user user 10 Feb 26 12:28 1.txt