I have a couple of lines and want to group the line into 5 and then implode it for MySQL IN () query.
IN ()
I have made it out until this
awk
#!/usr/bin/awk -f { a[NR] = $0 } END { for (b in a) { printf a[b] (b % 5 && b != NR ? "," : RS) } }
Or one liner:
awk '{a[NR]=$0} END {for (b in a) printf a[b] (b%5 && b!=NR ? "," : RS)}'