I'm getting lots of e-mailed forms. I'd like to reformat them to import to my database.
What I get:
Last: data1
First: data2
etc.
What I need:
data1<tab>data2 etc.
if it's in tfm I can't don't get it.
Thanks for your help.
selecting between markers
- martin
- Official Nisus Person
- Posts: 5227
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
This is really more a question of concocting the proper Find & Replace expressions. You might do best by looking at the PowerFind (Pro) part of the manual if you need help on this. That said I can give you a few solutions.
If your data is always exactly the same form then a simple Find & Replace would be best:
A more generalized solution that would process any form, regardless of the property names, would require a more complicated macro:
If your data is always exactly the same form then a simple Find & Replace would be best:
Code: Select all
Find and Replace 'Last: (.+)\nFirst: (.+)', '\1\t\2', 'E'
Code: Select all
$count = 0
# visit all named form properties
While Find ‘.+?: ’, ‘E’
Delete # delete property name
$count += 1
# insert value delimiter
Find ‘\n|$’, ‘E’
Insert Text “\t”
End
# warn about failure or delete the final tab
If $count == 0
Prompt ‘Found no form property name/value pairs in the document.’
Else
Delete
End