Reply to topic  [ 2 posts ] 
selecting between markers 
Author Message

Joined: 2003-08-25 07:22:56
Posts: 2
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.


2008-01-05 17:47:44
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
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:
Code:
Find and Replace 'Last: (.+)\nFirst: (.+)', '\1\t\2', 'E'


A more generalized solution that would process any form, regardless of the property names, would require a more complicated macro:
Code:
$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


2008-01-07 06:29:17
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software