Using regular pattern in VIM
I have one file to be formatted for special use, here are my original file and target file.
Original file:
__glXDisp_CreateContext 0x7a ../../../GL/glx/.libs/libglx.a(glxcmdsswap.o)
__glXDisp_CreateNewContext 0x116 ../../../GL/glx/.libs/libglx.a(glxcmdsswap.o)
Target file:
__glXDisp_CreateContext
__glXDisp_CreateNewContext
Following pattern was used to get my work done.
%s/^\(\S\+\).*$/^I^I^I\1/g
Notes: \S stands for white space character. ^I stands for tab character. \(, \) stands for the first matched pair that was referenced by "\1".