1. Reading a file into a "sequence"

The code below reads a text file (a few lines are shown) into a Euphoria 
sequence as shown. Because the file is a series of  quoted strings, 
delimited by commas....I guess I expected I would have a "sequence" 
ready made in "line" after each read....and that I could refer to each
quoted string in line as line[1] or line[2] or line[3] etc.

Not so it seems...but line[1..41] does give the 1st (41) characters in 
each line when displayed.

Yet, the tests for "%HDR" and "%TRL" fail when using line[1..4].

Something more is needed to allow referring to each quoted string in the
file as a member of a sequence....again as in line[1] or line[2] ??

*************************************
sequence line
   fn=open("tml_extract.txt","r")
   if fn < 1 then
  	puts(1, "Unable to open the disk file\n")
        abort(fn)
   else 
     while 1 do 
        line = gets(fn)
        if atom(line) then exit
        else  
          if equal(line[1..4], "%HDR") or equal(line[1..4], "%TRL") then
          	 a = 0
          else
             puts(1, line[1..41] & "\n")
          end if
        end if
     end while
   end if     


*********************   file sampling  ************
"%HDR","EXTRACT","11/17/2004 02:23:10 AM","UNIVERSITY OF ROCHESTER MEDICAL
CENTER"
"%DTL","000061474714","000001821707","BARNES","CHARLES","","03/31/2001","03/20/2001","03/20/2001","000001819.00","000000000.00","11/07/2004","E3R","000001819.00","A1O","
  ","86115","YJP115341192","     ","10549",,,,,,,"86","EMG ","C"," "
"%DTL","000079336343","000002008157","FRANCIS","DALE","","11/13/2004","09/19/2002","09/19/2002","000002198.00","000000000.00","11/01/2004","09","000000408.00","A1O","
  ","50102","132288832A","     ","02262",,,,,,,"50","BMT ","C"," "
"%DTL","000079336343","000002008157","FRANCIS","DALE","","11/13/2004","09/19/2002","09/19/2002","000002198.00","000000000.00","11/03/2004","17","000000408.00","A1O","
  ","50102","132288832A","     ","02262",,,,,,,"50","BMT ","C"," "

new topic     » topic index » view message » categorize

2. Re: Reading a file into a "sequence"

John F Dutcher wrote:
> 
> The code below reads a text file (a few lines are shown) into a Euphoria 
> sequence as shown. Because the file is a series of  quoted strings, 
> delimited by commas....I guess I expected I would have a "sequence" 
> ready made in "line" after each read....and that I could refer to each
> quoted string in line as line[1] or line[2] or line[3] etc.
> 
> Not so it seems...but line[1..41] does give the 1st (41) characters in 
> each line when displayed.
> 
> Yet, the tests for "%HDR" and "%TRL" fail when using line[1..4].
> 
> Something more is needed to allow referring to each quoted string in the
> file as a member of a sequence....again as in line[1] or line[2] ??
> 
> *************************************
> }}}
<eucode>
> sequence line 	
>    fn=open("tml_extract.txt","r")
>    if fn < 1 then
>   	puts(1, "Unable to open the disk file\n")
>         abort(fn)
>    else 
>      while 1 do 
>         line = gets(fn)
>         if atom(line) then exit
>         else  
>           if equal(line[1..4], "%HDR") or equal(line[1..4], "%TRL") then
>           	 a = 0
>           else
>              puts(1, line[1..41] & "\n")
>           end if
>         end if
>      end while
>    end if     
> </eucode>
{{{

> 
> *********************   file sampling  ************
> "%HDR","EXTRACT","11/17/2004 02:23:10 AM","UNIVERSITY OF ROCHESTER MEDICAL
> CENTER"
>
> "%DTL","000061474714","000001821707","BARNES","CHARLES","","03/31/2001","03/20/2001","03/20/2001","000001819.00","000000000.00","11/07/2004","E3R","000001819.00","A1O","
>   ","86115","YJP115341192","     ","10549",,,,,,,"86","EMG ","C"," "
>
> "%DTL","000079336343","000002008157","FRANCIS","DALE","","11/13/2004","09/19/2002","09/19/2002","000002198.00","000000000.00","11/01/2004","09","000000408.00","A1O","
>   ","50102","132288832A","     ","02262",,,,,,,"50","BMT ","C"," "
>
> "%DTL","000079336343","000002008157","FRANCIS","DALE","","11/13/2004","09/19/2002","09/19/2002","000002198.00","000000000.00","11/03/2004","17","000000408.00","A1O","
>   ","50102","132288832A","     ","02262",,,,,,,"50","BMT ","C"," "


The first for characters of the first line are  ...

   "%HD

you need to either break up each line into fields or do this ...

   if equal(line[1..6], "\"%HDR\"") or equal(line[1..6], "\"%TRL\"") then
 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: Reading a file into a "sequence"

I thought I'd get the find on the inappropriate reference [1..4] before
anyone answered...but you're too fast for me....Thanks

new topic     » goto parent     » topic index » view message » categorize

4. Re: Reading a file into a "sequence"

John F Dutcher wrote:
> 
> I thought I'd get the find on the inappropriate reference [1..4] before
> anyone answered...but you're too fast for me....Thanks

Here is a function to convert a Comma-Separated-Value string to
a sequence of fields. It handles escaped characters via the '\'
character and embedded quotes can also be represented by a twin
quotes.

function CSV_to_Sequence(object pText)
    sequence lResult
    integer lInField
    integer lFld
    integer lPos
    
    lResult = {}
    if atom(pText) then
        return lResult
    end if
    
    if length(pText) != 0 then
        if pText[length(pText)] = '\n' then
            pText = pText[1..length(pText)-1]
        end if
    end if
        
    lInField = 0
    lFld = 0
    lPos = 1
    while lPos <= length(pText) do
        if pText[lPos] = '"' then
            if lInField then
                if lPos != length(pText) then
                    if pText[lPos+1] = '"' then
                        -- First quote of a Double quote found.
                        lResult[lFld] &= '"'
                        lPos += 1
                    else
                        lInField = 0
                    end if
                else
                    -- End of field found.
                    lInField = 0
                end if
            else
                -- Start of field found
                lInField = 1
                lResult = append(lResult, {})
                lFld = length(lResult)
            end if
        elsif pText[lPos] = '\\' then
            -- Found the 'escape' lead in character
            if lInField then
                if lPos != length(pText) then
                    lPos += 1
                    if pText[lPos] = 'n' then  --New Line
                        lResult[lFld] &= 10 
                    elsif pText[lPos] = 't' then --Tab
                        lResult[lFld] &= 9
                    elsif pText[lPos] = 'r' then --Carriage Return
                        lResult[lFld] &= 13
                    elsif pText[lPos] = '\\' then -- Back Slash
                        lResult[lFld] &= '\\'
                    elsif pText[lPos] = 's' then -- Space
                        lResult[lFld] &= ' '
                    else
                        lResult[lFld] &= pText[lPos]
                    end if
                end if
            else
                -- ignore it
            end if
        else
            if lInField then
                -- add it to current field data
                lResult[lFld] &= pText[lPos]
            else
                -- do nothing as I'm not in a field.
            end if
        end if            
        lPos += 1
    end while
    
    return lResult
end function


Use it like this ...

  sequence Fields

  Fields = CSV_to_Sequence( gets(fh) )
 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

5. Re: Reading a file into a "sequence"

John F Dutcher wrote:
> 
> Something more is needed to allow referring to each quoted string in the
> file as a member of a sequence....again as in line[1] or line[2] ??

See if you can find kat's "strtok" library. Then you could do this:

line = gets(fn)
if not atom(line) then
   s = parse(",",line) -- from memory... might be other way around :)
...

Now s[1] = "%HDR", s[2] = "EXTRACT", etc...

new topic     » goto parent     » topic index » view message » categorize

6. Re: Reading a file into a "sequence"

On 17 Nov 2004, at 19:28, cklester wrote:

> 
> 
> posted by: cklester <cklester at yahoo.com>
> 
> John F Dutcher wrote:
> > 
> > Something more is needed to allow referring to each quoted string in the
> > file as a member of a sequence....again as in line[1] or line[2] ??
> 
> See if you can find kat's "strtok" library. Then you could do this:
> 
> line = gets(fn)
> if not atom(line) then
>    s = parse(",",line) -- from memory... might be other way around :)

It's s = parse(line,",") (or a few variations on that). Then if you build
another
sequence of the parsed lines, you can use the other strtok functions to sort 
it, retrieve, etc.. The readme is at 

http://www.tiggrbox.info/program/strtok-v2-1.html

There's probably errors in it, since i simply overwrote the existing file when 
someone reported a "bug". The one online is an old backup. BNut anyhow, 
better get it all now, because i won't pay for hosting from jail.

Kat

new topic     » goto parent     » topic index » view message » categorize

7. Re: Reading a file into a "sequence"

OK! What's this about Dogs at home and Kats going to jail.
Are we breaking her out of there or what?

new topic     » goto parent     » topic index » view message » categorize

8. Re: Reading a file into a "sequence"

You guys do a heck of a job...
The sub routine is a nice piece of work....
This is returned in "ex.err"  when called with the input below &
the code lines below:

    "sequence lengths are not the same (4 != 0)"

This seems to refer to line (12) of "CSV_to_Sequence(object pText)"


sequence Fields
   	
   fn=open("tml_extract.txt","r")
   if fn < 1 then
  	puts(1, "Unable to open the disk file\n")
        abort(fn)
   else 
     while 1 do 
        Fields = CSV_to_Sequence( gets(fn))
        if Fields = {} then exit
        else  .....
           -- etc. etc.


The first record in "tml_extract.txt" is:
(and does seem to contain (4) "fields")

"%HDR","EXTRACT","11/17/2004 02:23:10 AM","UNIVERSITY OF ROCHESTER MEDICAL
CENTER"

new topic     » goto parent     » topic index » view message » categorize

9. Re: Reading a file into a "sequence"

John F Dutcher wrote:
> 
> You guys do a heck of a job...
> The sub routine is a nice piece of work....
> This is returned in "ex.err"  when called with the input below &
> the code lines below:
> 
>     "sequence lengths are not the same (4 != 0)"
> 
> This seems to refer to line (12) of "CSV_to_Sequence(object pText)"
> 
> 
> }}}
<eucode>
> sequence Fields 
>    	
>    fn=open("tml_extract.txt","r")
>    if fn < 1 then
>   	puts(1, "Unable to open the disk file\n")
>         abort(fn)
>    else 
>      while 1 do 
>         Fields = CSV_to_Sequence( gets(fn))
>         if Fields = {} then exit
>         else  .....
>            -- etc. etc.
> </eucode>
{{{

> 
> The first record in "tml_extract.txt" is:
> (and does seem to contain (4) "fields")
> 
> "%HDR","EXTRACT","11/17/2004 02:23:10 AM","UNIVERSITY OF ROCHESTER MEDICAL
> CENTER"
> 

To check if 2 sequences are equal, use equal(s1, s2) instead of s1 = s2.
You're using 'if Fields = {} then', but you should be using 'if equal(Fields,
{}) then',
or even better: 'if length(Fields) = 0 then'.

--
Recycle your pets.
tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com

new topic     » goto parent     » topic index » view message » categorize

10. Re: Reading a file into a "sequence"

John F Dutcher wrote:
> 
> You guys do a heck of a job...
> The sub routine is a nice piece of work....
> This is returned in "ex.err"  when called with the input below &
> the code lines below:
> 
>     "sequence lengths are not the same (4 != 0)"
> 
> This seems to refer to line (12) of "CSV_to_Sequence(object pText)"
> 
> 
> }}}
<eucode>
> sequence Fields 
>    	
>    fn=open("tml_extract.txt","r")
>    if fn < 1 then
>   	puts(1, "Unable to open the disk file\n")
>         abort(fn)
>    else 
>      while 1 do 
>         Fields = CSV_to_Sequence( gets(fn))
>         if Fields = {} then exit
>         else  .....
>            -- etc. etc.
> </eucode>
{{{

> 
> The first record in "tml_extract.txt" is:
> (and does seem to contain (4) "fields")
> 
> "%HDR","EXTRACT","11/17/2004 02:23:10 AM","UNIVERSITY OF ROCHESTER MEDICAL
> CENTER"

This is one of those areas that Euphoria is a very unintuitive.  With the
'IF' statement, you can only use the relationship operators (= != < > ...)
with atoms and never with sequences. What happens is that when you do

  if Seq = A then

the phrase 'Seq = A' actually creates a new (temporary) sequence containing
ones and zeros, and passes that temporary sequence to the IF, but an 
IF statement must have the form ...
   
  if <atom-expression> then ...

I know, it is pretty stupid, and everyone trips over this at least once,
but that's what RDS believes is a good thing to do. 

Anyhow, to fix your problem do either this  ...

  if length(Fields) = 0 then exit end if (*don't forget the 'end if')

or

  if equal(Fields, {}) then exit end if (*don't forget the 'end if')

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

11. Re: Reading a file into a "sequence"

Derek Parnell wrote:
> 
> John F Dutcher wrote:
> > 
> > You guys do a heck of a job...
> > The sub routine is a nice piece of work....
> > This is returned in "ex.err"  when called with the input below &
> > the code lines below:
> > 
> >     "sequence lengths are not the same (4 != 0)"

Actually, the error message you get is really about a problem when
creating that temporary sequence I talked about earlier. 

The problem is caused by the '=' symbol having three distinct semantic
roles in Euphoria. 
(1) ASSIGNMENT: To copy the value of the thing to the right of it to
   the thing on the left of it.
(2) EQUALITY TEST: To see if the thing on the left has the same value 
   as the thing on the right.
(3) SEQUENCE OPERATION EQUALITY FUNCTION: Return a sequence such that each
   element reflects the result of an equality test on the respective
   elements in the right hand and left hand sequences.

Which operation is actually performed depends on the context that the
'=' symbol is found in by the interpreter. RDS has decided that role (3)
is the appropriate one to use in the context of an IF statement when one
of the expressions in the conditional expression is a sequence. Most of 
the rest of us would expect role(2) to be performed, but oh well, we can't
all be right, can we. 

Anyhow, when Euphoria sees your "Fields = {}" it tries to perform role(3).
But, in order to do that operation, the sequences on either side of the
'=' symbol must be the same length. In your case, you have 'Fields' 
which contains four elements (fields) and '{}' which contains zero
elements. Thus the error message.

If however, 'Fields' had have been an empty sequence, Euphoria would have
created a temporary (empty) sequence and then you would have got the 
error message "true/false condition must be an ATOM". 

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

12. Re: Reading a file into a "sequence"

Derek,

Great explanation....I was coming back initially to apologize
for the question .... using the "If equal(seq1, seq2) then"
works nicely as I discovered.

Definitley unfortunate the syntax is this thought provoking...
but I'll deal with it I imagine.

John D.

new topic     » goto parent     » topic index » view message » categorize

13. Re: Reading a file into a "sequence"

Derek Parnell wrote:
> 
>   if length(Fields) = 0 then exit end if (*don't forget the 'end if')
                          or the 'then'
                          or the do in while / for loops
                          as I do time and bl***** time again
                          C's got a lot to answer for (do!)

                          Chris
> 
> or
> 
>   if equal(Fields, {}) then exit end if (*don't forget the 'end if')
> 



http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/

new topic     » goto parent     » topic index » view message » categorize

14. Re: Reading a file into a "sequence"

uboy wrote:
> 
> OK! What's this about Dogs at home and Kats going to jail.
> Are we breaking her out of there or what?
> 

Honestly, it's comments like this that lead to flame wars lasting month's
(which Rob ignores), leading to discussion on the merits of 'goto'

Nice one, keep it up smile

And should that not have been "Kat's going to 'goto' jail"

Chris

PS (serious bit) re Kat's dog prob - I'm a vet in the UK - I'm on your side.
If you have a dog exhibiting potentially dangerous behaviour, you are well
within your rights to protect yourself - I have no qualms whatsover about
euthanasing dangerous dogs (anybody who responds to this will not get any
response from me, this is off topic, and just my expression of support
for Kat)

http://members.aol.com/chriscrylex/euphoria.htm
http://uboard.proboards32.com/

new topic     » goto parent     » topic index » view message » categorize

15. Re: Reading a file into a "sequence"

Along these same lines of thought....

I notice when I input several "fields" from a screen to
use as search arguments for values in the input file
(a quoted, comma delimted file),
I actually am having to "prepend" and "append" every field
from the screen with double quotes in order for "If equal(seq1, seq2)"
to find equality.
In most languages I've used (PL/I and SAS among many others), the
value between the double quotes in the input is viewed as "the value",
not the quotes themselves as well.
I'm hoping I'm missing something again....that would make having to
add quotes around all fields to make them "match" the file content
values addressed as "recd[1], recd[2], recd[3] etc" unnecessary ?

new topic     » goto parent     » topic index » view message » categorize

16. Re: Reading a file into a "sequence"

> I know, it is pretty stupid, and everyone trips over this at least once,
> but that's what RDS believes is a good thing to do. 
> 

And something very intuitive as well. s1 + s2 adds elements together, s1 = s2 
compares them together.
I have a lot of complaints about Eu lack of obviously needed features, but 
this one is one of the only bright spots.

CChris

> Anyhow, to fix your problem do either this  ...
> 
>   if length(Fields) = 0 then exit end if (*don't forget the 'end if')
> 
> or
> 
>   if equal(Fields, {}) then exit end if (*don't forget the 'end if')
> 
> -- Derek Parnell Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

17. Re: Reading a file into a "sequence"

Christian Cuvier wrote:
> 
> > I know, it is pretty stupid, and everyone trips over this at least once,
> > but that's what RDS believes is a good thing to do. 
> > 
> 
> And something very intuitive as well. s1 + s2 adds elements together, s1 = s2 
> compares them together.
> I have a lot of complaints about Eu lack of obviously needed features, but 
> this one is one of the only bright spots.
> 
> CChris
> 
> > Anyhow, to fix your problem do either this  ...
> > 
> >   if length(Fields) = 0 then exit end if (*don't forget the 'end if')
> > 
> > or
> > 
> >   if equal(Fields, {}) then exit end if (*don't forget the 'end if')
> > 
> > -- Derek Parnell Melbourne, Australia

Okay, but from both a consistency point of view and from a syntactic sugar point
of view, s1 = s2 should either:

Be equivalent to equal(s1, s2) when found in a conditional (if, when)
Have the result sequence (1, 0, 1, 1) be reduced to an atom that is TRUE if and
only if all of its elements are true, again only in a conditional statement (if,
when).

Personally I prefer the second example.




j.

new topic     » goto parent     » topic index » view message » categorize

18. Re: Reading a file into a "sequence"

----- Original Message ----- 
From: "Derek Parnell" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Wednesday, November 17, 2004 9:03 PM
Subject: Re: Reading a file into a "sequence"


> 
> 
> posted by: Derek Parnell <ddparnell at bigpond.com>
> 
> John F Dutcher wrote:
>> 
>> I thought I'd get the find on the inappropriate reference [1..4] before
>> anyone answered...but you're too fast for me....Thanks
> 
> Here is a function to convert a Comma-Separated-Value string to
> a sequence of fields. It handles escaped characters via the '\'
> character and embedded quotes can also be represented by a twin
> quotes.
> 
> }}}
<eucode>
> function CSV_to_Sequence(object pText)
>    sequence lResult
>    integer lInField
>    integer lFld
>    integer lPos
>    
>    lResult = {}
>    if atom(pText) then
>        return lResult
>    end if
>    
>    if length(pText) != 0 then
>        if pText[length(pText)] = '\n' then
>            pText = pText[1..length(pText)-1]
>        end if
>    end if
>        
>    lInField = 0
>    lFld = 0
>    lPos = 1
>    while lPos <= length(pText) do
>        if pText[lPos] = '"' then
>            if lInField then
>                if lPos != length(pText) then
>                    if pText[lPos+1] = '"' then
>                        -- First quote of a Double quote found.
>                        lResult[lFld] &= '"'
>                        lPos += 1
>                    else
>                        lInField = 0
>                    end if
>                else
>                    -- End of field found.
>                    lInField = 0
>                end if
>            else
>                -- Start of field found
>                lInField = 1
>                lResult = append(lResult, {})
>                lFld = length(lResult)
>            end if
>        elsif pText[lPos] = '\\' then
>            -- Found the 'escape' lead in character
>            if lInField then
>                if lPos != length(pText) then
>                    lPos += 1
>                    if pText[lPos] = 'n' then  --New Line
>                        lResult[lFld] &= 10 
>                    elsif pText[lPos] = 't' then --Tab
>                        lResult[lFld] &= 9
>                    elsif pText[lPos] = 'r' then --Carriage Return
>                        lResult[lFld] &= 13
>                    elsif pText[lPos] = '\\' then -- Back Slash
>                        lResult[lFld] &= '\\'
>                    elsif pText[lPos] = 's' then -- Space
>                        lResult[lFld] &= ' '
>                    else
>                        lResult[lFld] &= pText[lPos]
>                    end if
>                end if
>            else
>                -- ignore it
>            end if
>        else
>            if lInField then
>                -- add it to current field data
>                lResult[lFld] &= pText[lPos]
>            else
>                -- do nothing as I'm not in a field.
>            end if
>        end if            
>        lPos += 1
>    end while
>    
>    return lResult
> end function
> </eucode>
{{{

> 
> Use it like this ...
> 
>  sequence Fields
> 
>  Fields = CSV_to_Sequence( gets(fh) )
> 
> -- 
> Derek Parnell
> Melbourne, Australia

I created a csv lib a long time back. but lets all completely forget about that.
It is never used so why bother remembering that it even exists.

    unkmar

new topic     » goto parent     » topic index » view message » categorize

19. Re: Reading a file into a "sequence"

Jason Gade wrote:
[snip]
> Be equivalent to equal(s1, s2) when found in a conditional (if, when)
> Have the result sequence (1, 0, 1, 1) be reduced to an atom that is TRUE if
> and only
> if all of its elements are true, again only in a conditional statement (if,
> when).
> 
> Personally I prefer the second example.

Me too. The second example would make it more flexible.

Regards, Alexander Toresson

Shhh! Be vewy quiet! I'm hunting wuntime ewwows!

new topic     » goto parent     » topic index » view message » categorize

20. Re: Reading a file into a "sequence"

Unkmar wrote:
> 
> ----- Original Message ----- 
> From: "Derek Parnell" <guest at RapidEuphoria.com>
> To: <EUforum at topica.com>
> Sent: Wednesday, November 17, 2004 9:03 PM
> Subject: Re: Reading a file into a "sequence"
> 
> 
> > posted by: Derek Parnell <ddparnell at bigpond.com>
> > 
> > John F Dutcher wrote:
> >> 
> >> I thought I'd get the find on the inappropriate reference [1..4] before
> >> anyone answered...but you're too fast for me....Thanks
> > 
> > Here is a function to convert a Comma-Separated-Value string to
> > a sequence of fields. It handles escaped characters via the '\'
> > character and embedded quotes can also be represented by a twin
> > quotes.
> > 
[snip]

> I created a csv lib a long time back. but lets all completely forget about
> that.
> It is never used so why bother remembering that it even exists.

Your paranoia is showing blink 

How on Earth did you read into my response that I'd said something
like "Do not use unkmar's library! Use this instead!"? 

Or are we meant to prefix every response with "Please check the archives
and user submissions before proceeding"?

My routine was not meant as competition to your library or anybody else's
submissions either. But now that I think about it, a little 'competition'
like this is not necessarily a bad thing.

You don't see me saying "Don't use those other Windows libraries, use mine!"

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

21. Re: Reading a file into a "sequence"

On 18 Nov 2004, at 10:36, Lucius Hilley wrote:

> 
> 
> ----- Original Message ----- 
> From: "Derek Parnell" <guest at RapidEuphoria.com>
> To: <EUforum at topica.com>
> Sent: Wednesday, November 17, 2004 9:03 PM
> Subject: Re: Reading a file into a "sequence"
> 
> 
> > posted by: Derek Parnell <ddparnell at bigpond.com>
> > 
> > John F Dutcher wrote:
> >> 
> >> I thought I'd get the find on the inappropriate reference [1..4] before
> >> anyone answered...but you're too fast for me....Thanks
> > 
> > Here is a function to convert a Comma-Separated-Value string to
> > a sequence of fields. It handles escaped characters via the '\'
> > character and embedded quotes can also be represented by a twin
> > quotes.

<snip>

> > Derek Parnell
> > Melbourne, Australia
> 
> I created a csv lib a long time back. but lets all completely forget about
> that.
> It is never used so why bother remembering that it even exists.

Isn't that like how strtok lib should be thrown out, new code written for each 
slightly new app, and strtok not built upon? Can i be ticked off in your camp 
with you?

Kat,
meow.

new topic     » goto parent     » topic index » view message » categorize

22. Re: Reading a file into a "sequence"

----- Original Message ----- 
From: "Kat"
Sent: Thursday, November 18, 2004 7:05 PM
Subject: Re: Reading a file into a "sequence"


> 
> On 18 Nov 2004, at 10:36, Lucius Hilley wrote:
> 
>> ----- Original Message ----- 
>> From: "Derek Parnell" <guest at RapidEuphoria.com>
>> To: <EUforum at topica.com>
>> Sent: Wednesday, November 17, 2004 9:03 PM
>> Subject: Re: Reading a file into a "sequence"
>> 
>> 
>> > posted by: Derek Parnell <ddparnell at bigpond.com>
>> > 
>> > John F Dutcher wrote:
>> >> 
>> >> I thought I'd get the find on the inappropriate reference [1..4] before
>> >> anyone answered...but you're too fast for me....Thanks
>> > 
>> > Here is a function to convert a Comma-Separated-Value string to
>> > a sequence of fields. It handles escaped characters via the '\'
>> > character and embedded quotes can also be represented by a twin
>> > quotes.
> 
> <snip>
> 
>> > Derek Parnell
>> > Melbourne, Australia
>> 
>> I created a csv lib a long time back. but lets all completely forget about
>> that.
>> It is never used so why bother remembering that it even exists.
> 
> Isn't that like how strtok lib should be thrown out, new code written for each
>
> slightly new app, and strtok not built upon? Can i be ticked off in your camp 
> with you?
> 
> Kat,
> meow.

Yeah, welcome to my side of the fence.  No, wait.  I think that is more
like me being welcomed to your side.  Either way, Hi Kat.
* unkmar reaches down and pets Kat softly.

    unkmar

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu