I publish a list of U.S. hospitals that use social media: http://ebennett.org/hsnl 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 ed@ebennett.org
Thank you.
Adding new lines with find and replace
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
Adding new lines with find and replace
- Attachments
-
- TPFiles.zip
- Sample files
- (104.34 KiB) Downloaded 432 times
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Adding new lines with find and replace
The way to do this is to make use of a perl pattern like this:
\1 matches whatever the earlier bracket matched, so you can detect duplicates this way. This might give you a way forward
Code: Select all
(state).*(\1)