use strict; while (<DATA>) { s/( \w) /$1/g; print; } __DATA__ 3851 A A G G T T 3854 A A G G T T
Or as a one liner
perl -pi.bak -e 's/( \w) /$1/g' file.dat
And if you want to use "newer" regex features, the following is shorter:
s/ \w\K //g;
In reply to Re: Loop to merge every two columns
by wind
in thread Loop to merge every two columns
by Renyulb28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |