Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 46695  / 2 Years ago, mon, august 1, 2022, 2:33:12

I have a tab-delimited file like:



name1   verb1   name2   verb2   etc...


I want to delete the second column. I tried editing one of these answers, but being not familiar with sed and awk, I couldn't.



Can anyone help me?


More From » vim

 Answers
2

In vim, you should be able to use the command



:%s/	[^	]*//


(substitute TAB followed by zero or more occurrences of any character except TAB with nothing). If your file has only two columns you could use a slightly simpler :%s/ .* or :%s/ .*$which replace the first TAB and any following characters up to the end of the line.


[#22972] Monday, August 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
laiuct

Total Points: 44
Total Questions: 105
Total Answers: 107

Location: Seychelles
Member since Mon, Feb 15, 2021
3 Years ago
;