Re: [U2] CSV to Array

2012-08-20 Thread Keith Johnson [DATACOM]
No-one seems to have done it, but here's my version of the code. It's strange, I don't have a problem with CONTINUE and I don't even mind IF SOMETHING ELSE THIS = THAT which a lot of people really hate, but I just HAD to reverse the IF/CASE statement order. SUBROUTINE REXY(RECORD,TEXT) *

Re: [U2] CSV to Array

2012-08-16 Thread David Wolverton
: [U2] CSV to Array On 15/08/12 23:24, David Wolverton wrote: > I've done this in the past by doing this: > > SWAP DQUOTE WITH @AM > > Now, in theory, every EVEN attribute is a 'quoted' string - don't > touch the commas > Every ODD attribute is a 'n

Re: [U2] CSV to Array

2012-08-16 Thread David Wolverton
12 5:42 PM To: 'U2 Users List' Subject: Re: [U2] CSV to Array You can't have "3/4" Bolts" in the data stream -- that would not work. So that means the embedded " has to be 'escaped' - usually by a \.. So you'd have "3/4\" Bolts"

Re: [U2] CSV to Array

2012-08-16 Thread David Wolverton
; DW -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Mecki Foerthmann Sent: Thursday, August 16, 2012 2:26 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] CSV to Array The moment you start working in the engineer

Re: [U2] CSV to Array

2012-08-16 Thread Rex Gozar
It is tempting to use SWAP or CONVERT statements when parsing CSV, but they never handle all the possible cases correctly. You have to look at each character and keep track of state. rex ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://list

Re: [U2] CSV to Array

2012-08-16 Thread Wjhonson
Thanks for the support. As I was working my way through the code I posted I noticed that if you embedded in the quote is a check to see if the character we're on *and* the next character are both double quotes. But if that's true, than the initial check for a double quote to even get *into* th

Re: [U2] CSV to Array

2012-08-16 Thread George Gallen
Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Charlie Noah Sent: Thursday, August 16, 2012 5:26 AM To: U2 Users List Subject: Re: [U2] CSV to Array I have double quotes in my product descriptions, and yes, they are a pain! I

Re: [U2] CSV to Array

2012-08-16 Thread Michael Martin
-Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dianne Ackerman Sent: Thursday, August 16, 2012 7:52 AM To: U2 Users List Subject: Re: [U2] CSV to Array I actually enjoy reading wjhonson's "puzzle"

Re: [U2] CSV to Array

2012-08-16 Thread Dave Laansma
users-boun...@listserver.u2ug.org] On Behalf Of Dianne Ackerman Sent: Thursday, August 16, 2012 8:52 AM To: U2 Users List Subject: Re: [U2] CSV to Array I actually enjoy reading wjhonson's "puzzle" posts with code examples, etc. Maybe they can be flagged in the header so those of you who do

Re: [U2] CSV to Array

2012-08-16 Thread Dianne Ackerman
I actually enjoy reading wjhonson's "puzzle" posts with code examples, etc. Maybe they can be flagged in the header so those of you who don't want to read them can just skip them. -Dianne On 8/15/2012 5:49 PM, Tony Gravagno wrote: Anyone getting paid to play guessing games? Dude, get to the p

Re: [U2] CSV to Array

2012-08-16 Thread Wols Lists
On 15/08/12 23:24, David Wolverton wrote: > I've done this in the past by doing this: > > SWAP DQUOTE WITH @AM > > Now, in theory, every EVEN attribute is a 'quoted' string - don't touch the > commas > Every ODD attribute is a 'non-quoted' string... > > Double check me here in case I've lost

Re: [U2] CSV to Array

2012-08-16 Thread Charlie Noah
TAROW NEWSTRING := @AM:DATAROW NEWSTRING<-1> = DATAROW END NEXT XXX -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Wednesday, August 15, 2012 4:11 PM To: u2-users@listserver.u2ug.org

Re: [U2] CSV to Array

2012-08-16 Thread Mecki Foerthmann
STRING := @AM:DATAROW NEWSTRING<-1> = DATAROW END NEXT XXX -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Wednesday, August 15, 2012 4:11 PM To: u2-users@listserver.u2ug.org Subject: [U2

Re: [U2] CSV to Array

2012-08-15 Thread David Wolverton
SWAP ',' WITH @AM IN DATAROW NEWSTRING := @AM:DATAROW NEWSTRING<-1> = DATAROW END NEXT XXX -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Wednesday, August 15, 2012 4:11

Re: [U2] CSV to Array

2012-08-15 Thread larryh
> -Original Message- > From: Phil Walker > To: U2 Users List > Sent: Wed, Aug 15, 2012 3:02 pm > Subject: Re: [U2] CSV to Array > > > At risk of starting a flame war, I agree with Tony. I need to tune my > email > rules better. > >> -Original Message-

Re: [U2] CSV to Array

2012-08-15 Thread Wjhonson
t; To: u2-users@listserver.u2ug.org > Subject: Re: [U2] CSV to Array > > > There's no point in being abusive Tony. No one appreciates it. > > > -Original Message- > From: Tony Gravagno <3xk547...@sneakemail.com> > To: u2-users > Sent: We

Re: [U2] CSV to Array

2012-08-15 Thread Phil Walker
t; To: u2-users@listserver.u2ug.org > Subject: Re: [U2] CSV to Array > > > There's no point in being abusive Tony. No one appreciates it. > > > -Original Message- > From: Tony Gravagno <3xk547...@sneakemail.com> > To: u2-users > Sent: Wed, Aug 15, 2012

Re: [U2] CSV to Array

2012-08-15 Thread Wjhonson
There's no point in being abusive Tony. No one appreciates it. -Original Message- From: Tony Gravagno <3xk547...@sneakemail.com> To: u2-users Sent: Wed, Aug 15, 2012 2:50 pm Subject: Re: [U2] CSV to Array Anyone getting paid to play guessing games? Dude, get to the poi

Re: [U2] CSV to Array

2012-08-15 Thread Tony Gravagno
Anyone getting paid to play guessing games? Dude, get to the point. If this were presented as "I need help" I think many people would jump to help. But presenting this as a Mensa challenge is just wasting people's time. T Wjhonson wrote: > Rex Gozar uploaded this code, and someone (perhaps him) c

[U2] CSV to Array

2012-08-15 Thread Wjhonson
Rex Gozar uploaded this code, and someone (perhaps him) corrected it, but there's a redundancy here. I'm trying to fix it, in my own version, mostly perhaps I *hate* the CONTINUE, but the logic is a bit convoluted eh? Anyone spot the redundancy ? EQU COMMA TO ',' EQU DQ TO '"'