There are several options:
1) Replace blank items with dummies.
<cfset Text = Replace(Text,'||','| |','all')/>
<cfset Text = Replace(Text,'||','| |','all')/>
(You need to do it twice incase there are ajacant blanks.)
2) Use Java methods to handle it.
Not sure what the Java listlen equivalent is, but Text.split('|') will convert
to an array with blank items being blank items in the array, then you could do
arraylen
3) Count the delimiters and add one:
<cfset TheLength = 1+Len(REReplace(Text,'[^|]','','all'))/>
Other people can probably suggest other methods, which is best depends on what
you want to do (ie: if you /just/ want the length, or if you'll then be
manipulating the data afterwards).
>This list below really has 20 entries, but when I do a listlen on it, it
>returns 19. It doesn't read the NULL value in the second spot
>highlighted in red. I am reading a file that is generated from an
>outside system, where the administrator does not want change the way it
>works.
>
>1346||258806|19520722|F|1|2|1|21|0|20050113|1|2|2|1|2|2|3|3|99111
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274136
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4