bash - How can I separate a file with columns 1-7 of data into ONE column with all the data in order? -


for example, have of data want organized in way such output file purely numbers, rows 1-7 corresponding columns 1-7, rows 8-14 corresponding columns 1-7 on second row, , etc.

can using awk?

also

example of data:

total    31.6459262.4011 31.6463 31.6463  0.0006  0.0006  0.0007 total     0.0007  0.0007  0.0007  0.0007  0.0007  0.0008  0.0008 total     0.0008  0.0008  0.0008  0.0008  0.0008  0.0008  0.0008 total     0.0008  0.0008  0.0008  0.0008  0.0008  0.0008  0.0008 total     0.0008  0.0007  0.0007  0.0007  0.0006  0.0006  0.0006 total     0.0005  0.0005  0.0004  0.0003  0.0003  0.0002  0.0001 total     0.0001  0.0000 -0.0001 -0.0002 -0.0002 -0.0003 -0.0004 total    -0.0005 -0.0006 -0.0007 -0.0008 -0.0009 -0.0010 -0.0011 total    -0.0011 -0.0012 -0.0013 -0.0014 -0.0015 -0.0015 -0.0016 total    -0.0016 -0.0017 -0.0018 -0.0018 -0.0018 -0.0019 -0.0019 total    -0.0019 -0.0019 -0.0020 -0.0020 -0.0020 -0.0020 -0.0020 total    -0.0019 -0.0019 -0.0019 -0.0019 -0.0018 -0.0018 -0.0018 total    -0.0017 -0.0017 -0.0017 -0.0016 -0.0016 -0.0015 -0.0015 total    -0.0014 -0.0014 -0.0013 -0.0012 -0.0012 -0.0011 -0.0011 total    -0.0010 -0.0010 -0.0009 -0.0009 -0.0008 -0.0008 -0.0007 total    31.6459262.4010 31.6461 31.6462  0.0006  0.0006  0.0006 total     0.0007  0.0007  0.0007  0.0007  0.0007  0.0007  0.0007 total     0.0008  0.0008  0.0008  0.0008  0.0008  0.0008  0.0008 

the output lengthy type, consist of these numbers arranged in 1 column without 4 numbers repeat every often, 31.6459, 262.4010, 31.6461, , 31.6462. these 4 numbers not same, greater ~20. , repeat every 101 numbers.

output:

0.0006 0.0006 0.0007 0.0007 0.0007 0.0007 0.0007 0.0007 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0007 0.0007 0.0007 0.0006 0.0006 0.0006 0.0005 0.0005 0.0004 0.0003 0.0003 0.0002 0.0001 0.0001 0.0000 -0.0001 -0.0002 -0.0002 -0.0003 -0.0004 -0.0005 -0.0006 -0.0007 -0.0008 -0.0009 -0.0010 -0.0011 -0.0011 -0.0012 -0.0013 -0.0014 -0.0015 -0.0015 -0.0016 -0.0016 -0.0017 -0.0018 -0.0018 -0.0018 -0.0019 -0.0019 -0.0019 -0.0019 -0.0020 -0.0020 -0.0020 -0.0020 -0.0020 -0.0019 -0.0019 -0.0019 -0.0019 -0.0018 -0.0018 -0.0018 -0.0017 -0.0017 -0.0017 -0.0016 -0.0016 -0.0015 -0.0015 -0.0014 -0.0014 -0.0013 -0.0012 -0.0012 -0.0011 -0.0011 -0.0010 -0.0010 -0.0009 -0.0009 -0.0008 -0.0008 -0.0007 0.0006 0.0006 0.0006 0.0007 0.0007 0.0007 0.0007 0.0007 0.0007 0.0007 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 

there plenty of numbers repeat in data can't exclude ones mention based on them repeating - want exclude numbers value >= 20?

if so, may want using gnu awk fieldwidths:

$ awk 'begin{fieldwidths="8 8 8 8 8 8 8 8"}        {for (i=2;i<=nf;i++) if ($i<20) {sub(/^ +/,"",$i); print $i} }' file 0.0006 0.0006 0.0007 0.0007 0.0007 0.0007 0.0007 0.0007 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0007 0.0007 0.0007 0.0006 0.0006 0.0006 0.0005 0.0005 0.0004 0.0003 0.0003 0.0002 0.0001 0.0001 0.0000 -0.0001 -0.0002 -0.0002 -0.0003 -0.0004 -0.0005 -0.0006 -0.0007 -0.0008 -0.0009 -0.0010 -0.0011 -0.0011 -0.0012 -0.0013 -0.0014 -0.0015 -0.0015 -0.0016 -0.0016 -0.0017 -0.0018 -0.0018 -0.0018 -0.0019 -0.0019 -0.0019 -0.0019 -0.0020 -0.0020 -0.0020 -0.0020 -0.0020 -0.0019 -0.0019 -0.0019 -0.0019 -0.0018 -0.0018 -0.0018 -0.0017 -0.0017 -0.0017 -0.0016 -0.0016 -0.0015 -0.0015 -0.0014 -0.0014 -0.0013 -0.0012 -0.0012 -0.0011 -0.0011 -0.0010 -0.0010 -0.0009 -0.0009 -0.0008 -0.0008 -0.0007 0.0006 0.0006 0.0006 0.0007 0.0007 0.0007 0.0007 0.0007 0.0007 0.0007 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 0.0008 

i feel have come briefer example btw.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -