Saari Development

This blog is intended to be a log of my (Ali Rizvi's) professional ramblings as a software development engineer. I intend to add logs of my experience with different technologies, software, tech books/articles and related stuff from time to time. My intention is to have an archive for my personal use and public benefit.

Sunday, February 19, 2006

vim extracting first column (space delimited)

Just figured out how to extract a single (first) column from a file containing text

:%s/^\(\w\+\)\.\*/\1/g

I am sure there is a better way to do this but this is best I can get for now. I don't like the excessive escaping vim requires in regex.

PS: Just figured out that you have to have:

:set nomagic

for the above subsitution to work.

0 Comments:

Post a Comment

<< Home