parsing - Breaking a big file down into smaller files on special char in bash script -
i have huge file 800,000 words in separated | character. write bash script reads file, on every 1000 | dump content file , continues until have
your post appears cut off, gather script should started.
awk 'begin{ fs="|" y=1 outputfile="/tmp/outfile" }{ (i=1; i<=nf; i++) { tmpoutput=tmpoutput" "$i if (y == 1000) { y=1 print tmpoutput > outputfile tmpoutput="" } else { y++ } } }end{ print tmpoutput > outputfile }' inputfile
Comments
Post a Comment