Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Boydell, Stuart
There's a page on pickwiki.com on handling csv with example code. http://www.pickwiki.com/cgi-bin/wiki.pl?CSV Stuart. -Original Message- I've received some import files (csv) that use either a CR and/or LF character in a test field (surrounded by "-marks). It seems to be somebody's idea

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Ed Clark
viously if the line ends while in a quoted string, the next line >>> belongs to the current line. Man, what a pain this was! :-) >>> >>> Thanks for your thoughts and help. >>> >>> Bill >>> >>> ------------------------ >>> -

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread George Gallen
users@listserver.u2ug.org Subject: Re: [U2] [UD] Extract a line with a CR and/or LF character in it. On 26/05/11 13:26, Rex Gozar wrote: > For any CSV processing, you must process character by character. Use > OSBREAD to get a block of characters and start parsing. Strings like > 1,AB

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Bill Haskett
SV files. Bill - Original Message - *From:* u...@edclark.net *To:* U2 Users List *Date:* 5/26/2011 6:48 AM *Subject:* Re: [U2] [UD] Extract a line with a CR and/or LF character in it. just an idea I haven't thought about too deeply: Use readseq to read a line

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Bill Haskett
:* 5/26/2011 5:14 AM *Subject:* Re: [U2] [UD] Extract a line with a CR and/or LF character in it. In your subroutine, if you first convert @FM -> char(250) Then do your line scan, when your inside a quote , if you encounter a char(250) convert it to a char(253) once your done, convert c

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Bill Haskett
-- *From:* syme...@gmail.com *To:* 'U2 Users List' *Date:* 5/26/2011 12:26 AM *Subject:* Re: [U2] [UD] Extract a line with a CR and/or LF character in it. Thats the way i process csv, because of the cr/lf issue but also you can have double set of quotes inside a quoted field and of course h

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Wols Lists
On 26/05/11 13:26, Rex Gozar wrote: > For any CSV processing, you must process character by character. Use > OSBREAD to get a block of characters and start parsing. Strings like > 1,ABC,"2"" adapter",, can only be correctly parsed by looking at each > character and applying the simple CSV rules.

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Dave Davis
Clark Sent: Thursday, May 26, 2011 9:49 AM To: U2 Users List Subject: Re: [U2] [UD] Extract a line with a CR and/or LF character in it. just an idea I haven't thought about too deeply: Use readseq to read a line, then use the COUNT() function to count the quotes. If there are an odd number

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Ed Clark
--- > - Original Message - > *From:* alfke...@hotmail.com > *To:* u2-users@listserver.u2ug.org > *Date:* 5/25/2011 10:13 PM > *Subject:* Re: [U2] [UD] Extract a line with a CR and/or LF character in it. >> It's been a while - but I&#x

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Rex Gozar
On Thu, May 26, 2011 at 8:24 AM, George Gallen wrote: > This shouldn't be a problem if your using " to flip a "QuoteOn" flag. > > "field ""description"" here" > > first quote would trigger the flag on > the first double quote would trigger the flag off, then on again > the second doub quote would

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Rex Gozar
For any CSV processing, you must process character by character. Use OSBREAD to get a block of characters and start parsing. Strings like 1,ABC,"2"" adapter",, can only be correctly parsed by looking at each character and applying the simple CSV rules. Using CONVERT statements only makes the pro

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread George Gallen
_ From: u2-users-boun...@listserver.u2ug.org [u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen [syme...@gmail.com] Sent: Thursday, May 26, 2011 3:26 AM To: 'U2 Users List' Subject: Re: [U2] [UD] Extract a line with a CR and/or LF character in it. Thats the way i process csv, because

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread George Gallen
Wyanoke Group http://www.wyanokegroup.com From: u2-users-boun...@listserver.u2ug.org [u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett [wphask...@advantos.net] Sent: Thursday, May 26, 2011 2:57 AM To: U2 Users List Subject: Re: [U2] [UD] Extract a line

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-26 Thread Symeon Breen
is to preprocess the csv using the linux tr command. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett Sent: 26 May 2011 07:58 To: U2 Users List Subject: Re: [U2] [UD] Extract a line with a CR and/or LF

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-25 Thread Bill Haskett
a pain this was! :-) Thanks for your thoughts and help. Bill - Original Message - *From:* alfke...@hotmail.com *To:* u2-users@listserver.u2ug.org *Date:* 5/25/2011 10:13 PM *Subject:* Re: [U2] [UD] Extract a line with a CR and/

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-25 Thread Colin Alfke
It's been a while - but I'm pretty sure that OSBREAD keeps the CR/LF as part of the block (you may need to put NO CONVERT ON in the code). READSEQ automatically ends at the CR/LF so you would have to "put the lines together" if you were short fields. In both cases it would mean going through

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-25 Thread Bill Haskett
--- - Original Message - *From:* alfke...@hotmail.com *To:* u2-users@listserver.u2ug.org *Date:* 5/25/2011 9:20 PM *Subject:* Re: [U2] [UD] Extract a line with a CR and/or LF character in it. For text files I like to use openseq and readseq. With embedded CR/LF's (which are actually vali

Re: [U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-25 Thread Colin Alfke
For text files I like to use openseq and readseq. With embedded CR/LF's (which are actually valid in a csv file) you would have to see if you needed to put the lines back together. There were a couple of examples of reading csv files a while back in CDP. The other alternative is to use osopen

[U2] [UD] Extract a line with a CR and/or LF character in it.

2011-05-25 Thread Bill Haskett
I've received some import files (csv) that use either a CR and/or LF character in a test field (surrounded by "-marks). It seems to be somebody's idea of multi-value. However, I'm having a hard time extracting them (dynamic length lines) because UD considers it a field-mark. Therefore, the R