I want to remove the first column of a text file using vim. I read these SO answers where visual mode is used, but they only remove the first character (as for answers using patterns, I don't understand them, so I have problems adapting them to my situation).
My file contains many numbers, and I want to remove the numbers in the first column, not just the first element.
eg,
12 34 43143 1 131234 1 1 3443 132
I would like to have
34 43143 1 1 3443 132
but currently i'm getting
2 34 43143 1 31234 1 3443 132
Numbers are separated by tabs, if that matters
Check this: %s/\v^\d*\s//gyou can replace \swith \t, if it is divided into a tab,
%s/\v^\d*\s//g
\s
\t
\v , , , ( "(" ), ( "{" ) .. , \d , * 0 , \s , % , %s , g , carret (^) . \v g, .
\v
\d
%s
g
^
Edit: : %s/^\d*\s//, Jeff
%s/^\d*\s//
vim help -
:h \v :h \d
e.t.c,
() [0-9] , \d; , \+ . \t, \s. /:substitute (^) .
[0-9]
\+
:substitute
:%s/^\d\+\t//
% , . :help :range.
%
:help :range
; (, ^\d\+\t\zs\d\+\t ) ( !) .
^\d\+\t\zs\d\+\t
, , , , (CSV). (csv.vim - Filetype csv, :DeleteColumn - , ! ( ...)
:DeleteColumn
Another alternative is to use a macro:
qq0dawjq
Then you need to use a macro: @q or 3 @q or any number + @q
Explanation:
q: Start Recording a Macro q: Save the macro in register q 0: Go to the beginning of the line daw: Delete A Word j: Move down to the next line q: Finish the recording
This is a quest for cut!
cut
:%!cut -f 2-
you need to make type
:%s/\d\+\t//