I've read lots of very helpful posts about adding tabs between every number and letter, or adding/deleting tabs and spaces in other locations within a string, but I'm struggling to adapt those solutions to my current problem, so I figured it was worth adding to the stack! I have a bunch of genetic data that looks like this:
chr1 1324000 1325000tgagggtctgctg...
chr1 1318000 1319000gggactgcagctg...
etc.
Is there a way to add a tab between the last number and the first letter? The lengths of the sequences vary, so the tab isn't always going to be in the same position. Additionally, the first set of numbers don't always end in 0. However, the tab will always be immediately after the last number. I think it's going to be something like:
sed -e 's/\([[0-9]\+]\)/[\t/'
But of course this doesn't work. How can I tell sed to put a tab in this location?
Desired output:
chr1 1324000 1325000 tgagggtctgctg...
chr1 1318000 1319000 gggactgcagctg...
sed -E 's/([0-9])([acgt])/\1\t\2/' file