Page 1 of 1

Optional field dilemma any ideas?

Posted: Tue Nov 08, 2005 2:00 pm
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??

Posted: Tue Nov 08, 2005 10:43 pm
by DataMystic Support
Use 'longest optional' instead of just 'optional'