Skip to content
Advertisement

Insert text if column contains a number

I have a tab-delim file that looks like this

JavaScript

It should be three columns but some rows are missing the second column (bacterial taxonomy). For these rows I want to move the number to a third column and insert some text (such as Unclassified).

I have been attempting to modify some commands I found online to insert Unclassifiedt before any value in the second column which starts with a number but have been unable to get it working.

Any help would be much appreciated.

Advertisement

Answer

give this line a try:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement