val() will do that for you, but that's a rather course approach.  If
you have a know format (e.g. one number then one letter), you'd be
better parsing it explicitly (e.g., left(value, 1)) rather than using
something like val().

cheers,
barneyb

On Fri, Oct 2, 2009 at 12:48 AM, Damo Drumm
<damien.dr...@quinn-group.com> wrote:
>
> HI, Im having a slight problem while importing text files to a database, Im 
> using the below code, but it displaying an error (The Value 2F cannot be 
> converted to a number)
> How do i get it to ignore the F and just look at the 2 using code?
>
> <cfif len(i) gte 6>
>                <!--- Temp value of line number --->
>
>                <cfset tempvvalue1 = trim(left(i,4))>
>                <!--- Invoice Line Text --->
>                <cfset stringvalue = left(right(i,Len(i)-5),130)>
>                <!--- Calculate Line Numbers --->
>        <cfif isNumeric(tempvvalue1)>
>                <cfset linenumber = right(tempvvalue1,2)>
>                <cfelse>
>                <cfset vvalue2 = trim(left(i,6))>
>                <cfset linenumber = right(linenumber + vvalue2,2)>
>        </cfif>
>                <cfif linenumber eq 26>
>                <cfset invoicenumber = trim(right(left(i,74),20))>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326830
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to