Remove chars from beginning of line using vi
Hi,
I would like to remove n characters from the beginning of all lines in a file using vi. Can someone please let me know the command to do this? Thanks, John |
Not sure of your level of experience.
In command mode, press the colon; next enter the command below and press <enter> Code:
1,$s/^.\{5}// |
Brilliant.
Thanks, that worked perfectly Quote:
|
many ways to skin a cat..
in command mode type in the number of characters you'd like to remove, then 'c' for change, then press the space key and then escape. if you'd like to change the first word, you can use cw for "change word" |
Quote:
|
All times are GMT -5. The time now is 07:45 AM. |