Assuming the following text file, which is actually a data dump of funds and price statistics:
PBCPDF
05/01/2006
0.0000
0.0000
PBCPDF
0.0000
06/01/2006
0.0000
0.0000
PBCPDF
0.0082
[… lines repeat …]
What I wanted to achieve is to delete all instances of PBCPDF
except for the first one, which I could write the substitution command as :.+1,$s/PBCPDF\n//g
.
However, since I wanted to program a macro to process multiple fund names, I need a means to use some sort of pattern that would retrieve the current line as the search pattern without me doing it by hand.
Is there a way to do that?