Optional field dilemma any ideas?

Get help with installation and running here.

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

Post Reply
danieluub
Posts: 1
Joined: Fri Oct 28, 2005 11:25 am
Location: Data Analyst

Optional field dilemma any ideas?

Post by danieluub »

Can have up to 10 optional fields in the data I am mining. But I think I need to create lines which are blank with a line number to get the optional delimiter to work.

Example:

00001 CLIVE PEETERS LIMITED CPR
00002 www.clivepeeters.com.au/
00003 289-311 Bayswater Road
00004 BAYSWATER NORTH
00005 VICTORIA
00006 3153
00007 (03) 9721 8400


['00001', capture( 1+ linechar ), cr, lf,
optional('00002 ', capture( 1+ linechar ), cr, lf, )
optional('00003 ', capture( 1+ linechar ), cr, lf, )
optional('00004 ', capture( 1+ linechar ), cr, lf, )
optional('00005 ', capture( 1+ linechar ), cr, lf, )
'00006', capture( 1+ linechar ), cr, lf]

$1,$2,$3,$4,$5,$6

Any ideas on how to best do this to create multiple optional fields within the one file??
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Use 'longest optional' instead of just 'optional'
Post Reply