Hi,
I want to delete a column from a file while inside a vi session. I know the awk solution I want to know if it is possible using vi.
Cheers,
Pravin.
Well its more like I am in the middle of a session in vi . I don't want to save the file, go to the shell, run awk and come back to vi for more editing.
Lets say I am editing a file like this
1 Pravin - He loves ice creams
2 Rahul - He too loves ice creams
Now I open it in vi and change it to
1 Pravin - He loves girls
2 Rahul - He just loves ice creams
Now I realise I want to remove the line numbers so that it becomes
Pravin - He loves girls
Rahul - He just loves ice creams
It would be nice if I could do it without exiting vi .. for I may change my mind again ;-)
Well .. it works for this example but I want a more generic solution where I can remove a column of data from a file I am editing in vi. Lets say no search pattern works. All you have is space " " separated data
adfkj asdflkj wqeroiu adfk
adsk qwep dai qwer oupu
adsfu qwer cou wer cou
Now I want to remvoe the second column, Can I do it?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.