Adding new lines with find and replace

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Posts: 2
Joined: Tue Jan 04, 2005 10:28 am
Location: Baltimore, Maryland USA

Adding new lines with find and replace

Post by forward1 »

I publish a list of U.S. hospitals that use social media: The data is managed in an Excel file, and my conversion process is:

1. Sort the primary excel table by organization name
2. Build out a single text file using the CONCATENATE function
3. Take the text file and process it with TextpipePro into HTML

This works fine for a single A to Z list, but I'd like also split the list by State. I can sort the excel file by State, then organization name to get a text file with the right order, but then I need a Textpipe filter that will:

1. Find the first occurrence of a unique string
2. Insert a new line of text above the line with that match.

Attached are my working files and current TP filter. I build unique text patterns around each data element, which makes Find and Replace easy to manage.

Any help is appreciated, and I'm also willing to hire an expert. I can be reached at

Thank you.
Sample files
(104.34 KiB) Downloaded 362 times
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

Re: Adding new lines with find and replace

Post by DataMystic Support »

The way to do this is to make use of a perl pattern like this:

Code: Select all

\1 matches whatever the earlier bracket matched, so you can detect duplicates this way. This might give you a way forward
Post Reply