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

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -