RE: Flat file to associative array.

Discussion in 'Python' started by Delaney, Timothy C (Timothy), Jul 22, 2003.

  1. > From: Alex [mailto:]
    >
    > What would be the best way to convert a flat file of products into
    > a multi-dimensional array? The flat file looks like this:
    >
    > Beer|Molson|Dry|4.50
    > Beer|Molson|Export|4.50
    > Shot|Scotch|Macallan18|18.50
    > Shot|Regular|Jameson|3.00


    Have you tried any of the CSV/DSV (delimiter-separated libraries). They may be overkill, but you may also be able to get a 1 or 2 line solution out of them.

    Tim Delaney
    Delaney, Timothy C (Timothy), Jul 22, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    2
    Views:
    983
    John Hunter
    Jul 22, 2003
  2. desktop
    Replies:
    5
    Views:
    376
    James Kanze
    Jun 26, 2007
  3. Yvon Thoraval
    Replies:
    5
    Views:
    200
    Jason Creighton
    Sep 17, 2003
  4. VK
    Replies:
    47
    Views:
    522
    Thomas 'PointedEars' Lahn
    Jul 13, 2005
  5. VK
    Replies:
    36
    Views:
    624
    Martin Honnen
    Aug 3, 2005
Loading...

Share This Page