Page 1 of 1

Surrounding the first line of text with delimiters

Posted: Fri Mar 02, 2007 1:19 am
by frankm
I'm sure this is probably easy for someone who is an expert in regular expressions....unfortunately, I'm not.

I have about 1,000 text files in a folder.

I want to surround the first line of text only in each file with the following delimiters #TITLE# and #/TITLE#

e.g. if the first line of a text file is "This is the title", I want the first line to now read "#TITLE#This is the title#/TITLE#".

Thank you in advance,
Frank

Posted: Fri Mar 02, 2007 7:30 am
by Abacre
Exactly. It's quite simple task.

Go to main menu - Action - Options - Batch Replace
uncheck "Modifier S"
uncheck "Modifier G"
check "Modifier M"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
\A(.*)$

Replace with:
#TITLE#$1#/TITLE#

That's all I verified it works perfectly.