The Invoice will not change
This is absolutely true,... until the guy who said it will not change is
changed ;-)
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion
All i need it to do is, check if line 26 has text in it, and if so not to check
line 27
this piece of code is doing part of that, only its checking Line 27 also and
inputting whats in it also
cfif previouslinenumber eq 26
cfset linenumber = 27
/cfif
cfif (linenumber eq
-
From: Damo Drumm [mailto:damien.dr...@quinn-group.com]
Sent: Wednesday, October 21, 2009 9:23 AM
To: cf-talk
Subject: Re: Checking line 26 or 27
All i need it to do is, check if line 26 has text in it, and if so not
to check line 27
this piece of code is doing part of that, only its checking
Wow... I just re-read what I wrote. I sounded like a jerk didn't I.
Sorry about that didn't mean it that way.
-Original Message-
From: DURETTE, STEVEN J (ATTASIAIT)
Sent: Wednesday, October 21, 2009 11:15 AM
To: cf-talk
Subject: RE: Checking line 26 or 27
I think the logic is a little
No, I think im confusing you now :-)
in some cases the invoice number is on line 26, and it other cases the invoice
number is on line 27. all runs fine when the invoice number is on line 27
because theres nothing on line 26 to print so therfore it leaves it
but its messing up when the invoice
. If you don't want to share with everyone you
can send it directly to me at sd1985 (at) att (dot) com
Steve
-Original Message-
From: Damo Drumm [mailto:damien.dr...@quinn-group.com]
Sent: Wednesday, October 21, 2009 11:36 AM
To: cf-talk
Subject: Re: Checking line 26 or 27
No, I think im
about that didn't mean it that way.
-Original Message-
From: DURETTE, STEVEN J (ATTASIAIT)
Sent: Wednesday, October 21, 2009 11:15 AM
To: cf-talk
Subject: RE: Checking line 26 or 27
I think the logic is a little off.
You only need either line 26 or line 27.
cfset invoicenumber
Just sent it to you now!
nothings changing the invoice number
Yes, that is why my code set invoice = .
Then set invoicenumber = line 26.
Go to line 27 if invoicenumber has a length then continue on, if not set
the invoice number to the value on line 27.
Ok, so my code didn't work... Is
Hi
Im uploading textfiles to a database, im using the below code, as the invoive
number is either on line 26 or 27.
can anyone help me out here as its using info from both lines. If the invoice
is on line 26 I dont want it to check line 27, but if line 26 is blank, i want
it to check line 27
This doesn't sound like a very robust method.
Are you able to provide sample invoice(s)?
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
Its simply looking at line 26 for the invoice number and inputting it in a
table. but on some invoives line 26 is blank, so i need it to check line 27,
but only if line 26 is blank.
at the minute its checking both lines and inputting info from both lines
This doesn't sound like a very robust
Its simply looking at line 26 for the invoice number and inputting it in a
table. but on some invoives line 26 is blank, so i need it to check line 27,
but only if line 26 is blank.
at the minute its checking both lines and inputting info from both lines
How about something like this (untested):
cfset crlf = chr(13) chr(10) /
cfset lineArray = reMatch(crlf, myFile) /
cfif len(trim(lineArray[26]))
cfset invoiceNumber = trim(lineArray[26]) /
cfelse
cfset invoiceNumber = trim(lineArray[27]) /
/cfif
The variable 'invoiceNumber' should now hold
As I said, relying on line numbers doesn't seem like a robust method - what
happens if the top of the invoice is changed, and it suddenly becomes line
15/16 or 32/33 or something else?
Ideally you refer specifically to the location of the invoice number, hence
asking for a sample of the
The Invoice will not change, its only ever going to be on line 26 or line 27
I tried your code but all i get is an error messag saying:
You have attempted to dereference a scalar variable of type class
java.lang.String as a structure with members.
When i copy the invoice in here it goes all
The Invoice will not change, its only ever going to be on line 26 or line 27
I'd say the odds of that being the case are low... things like this frequently
come back to bite you.
I tried your code but all i get is an error messag saying:
You have attempted to dereference a scalar
Damo,
Did you try the attempt I outlined above (reproduced here)? You've got to get
the lines into an array first, then you should be able to refer to them by [26]
or [27], as Peter and I pointed out.
How about something like this (untested):
cfset crlf = chr(13) chr(10) /
cfset lineArray
Just noticed you're using rematch there - which is good since ListToArray will
remove blank lines (not what we want).
However, you can simplify it - instead of the crlf variable you can do:
cfset lineArray = reMatch( '\r\n' , myFile ) /
And, once you're there, it's one extra character to do:
18 matches
Mail list logo