Re: DELIMITED DATA FILES TO SEQUENCE

new topic     » goto parent     » topic index » view thread      » older message » newer message

Yes,  you  can  use  the CSV library, it will read a file separated by
commas  (just  change  it  if you want another delimiter) and return a
sequence as you described below.

http://www.rapideuphoria.com/contrib.htm





Z> posted by: ZNorQ <znorq at holhaug.com>

Z> I've known about Euphoria for a long time now, but it is untill now
Z> i've tried to learn it. Looks quite powerful, and what I like most
Z> is the SEQUENCEs.

Z> As I make quite a few utilities for workrelated tasks, I was thinking
Z> of going over to Euphoria instead of using O'Basic (which is really
Z> easy, yet quite powerful.) in hope that Euphoria can help me out 
Z> better than the restrictions in O'Basic's arrays. Euphoria is a new
Z> way of thinking, and I haven't quite gotten used to it yet! :D

Z> What I'm looking for is an include file that can read a data file 
Z> (text format - where data is placed in a record/field structure 
Z> separated by a special delim. character, like TAB, ';' etc.)
Z> and build a SEQUENCE from that file.

Z> An example of the content of a file, where [TAB] is the char(9);
Z> HEADING ONE [TAB] HEADING TWO [TAB] HEADING THREE
Z> DATA ONE    [TAB] DATA TWO    [TAB] DATA THREE
Z> DATA ONE    [TAB] DATA TWO    [TAB] DATA THREE

Z> the result would be;
Z> {
Z> {"HEADING ONE", "HEADING TWO", "HEADING THREE"},          -- Record 1
Z> {"DATA ONE", "DATA TWO", "DATA THREE"},                   -- Record 2
Z> {"DATA ONE", "DATA TWO", "DATA THREE"}                    -- Record 3
Z> }

Z> This will be used to view this data for example in Win32Lib's
Z> List View control. (I know how to do that! :D)

Z> I'd probably make it work if really I put my head into it, but right now
Z> im trying to absorb as much as possible about the language, and I'm
Z> spending most of my time getting to know Win32Lib.

Z> What I would like to know is if any of you know if a code snippet
Z> of this sort already exists?

Z> Kenneth 'ZNorQ'

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu