Search Results

Search: Posts Made By: avvk
2,734
Posted By avvk
yesyesyes
Have found the way

BEGIN {FS=OFS=" "}

{
for (i=1;i<=NF;i++)
{
arr[NR,i]=$i;
}
}

END {
h=0
for(j=3;j<=NF;j=j+2)
{
h=h+1;
k="M_"h;
if...
2,734
Posted By avvk
not good yet
I didn't specify it good.
Any column pair can be missing (from 1 to (NF-2)/2) so that's why I have loop : for (i=3; i<=NF; i=i+2)
and then j=j+1, as counter

In above example you can see missing...
2,734
Posted By avvk
fill in missing columns
It can't be that hard, but I just can't figure it out:
I have file like:
File Sub-brick M_1 S_1 M_2 S_2 M_4 S_4 ...
xxx 1 214 731 228 621 132 578 ...

and would like to get 0 0 where M_3 S_3...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 10:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy