Adding new lines with find and replace

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Adding new lines with find and replace

Postby forward1 » Sun Nov 22, 2009 4:32 am

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 210 times

User avatar
DataMystic Support
Site Admin
Posts: 2140
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

Re: Adding new lines with find and replace

Postby DataMystic Support » Mon Nov 23, 2009 7:06 am

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

Simon Carter, - Insulin dose calculator for Type 1 diabetes - 250,000 free software downloads - send huge email attachments

Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 3 guests