I have the text file where each line has the format:
chr10 101418889 101418904 0.816327
Right now the interval between column 2 and 3 is 15. I only want the two consecutive positions starting at position 1, write it to a file, then move up one position write to file etc. So that:
File 1: chr10 101418889 101418990 0.816327
File 2: chr10 101418890 101418991 0.816327
File 3: chr10 101418891 101418992 0.816327
and so on...
My code so far:
for ((i = 0; i <= 14; ++1)) do
awk -v h=$i '{$2 += h; $3 += h-14; print}' original_core_files/lung.core.low.5SitesMin.bed > ../core_motif_singleton_controls/script/$i.bed;
done
The output is a "0.bed" file and a stuck loop.
As you probably see my programming experience is very limited, thank you very much for any form of help!
---------- Post updated at 04:36 AM ---------- Previous update was at 04:29 AM ----------
Solved:
naturally I should have put i++ instead of ++1, is there a way to delete embarrassing threads like this one?