• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Importing CSV into a WO application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Importing CSV into a WO application


  • Subject: Re: Importing CSV into a WO application
  • From: Dev WO <email@hidden>
  • Date: Mon, 23 Oct 2006 21:33:31 +0200

Hello Chuck,
I'll have a look at it too:)
Hopefully I'll be choosing which direction to go by tomorrow:)

Thanks,

Xavier



Hi Xavier,

On Oct 23, 2006, at 3:30 AM, Dev WO wrote:
Hi,
searching the list I have found many post about excel export and things like that. But I'm actually looking for a way to import CSV into a WO application.


Is there anything already done to handle importing of CSV?

Like providing a NSArray of column name, an editing context and an eo to match the value to?

If you look in GVCFoundation, there is a DelimitedStringTokenizer (ignore the incorrect class comments that someone copied and pasted from FixedWidthStringTokenizer) that can be used to parse out each line of CSV. It handles quotes, embedded commas etc.


In the GVCVirutalTables framework in VirtualTable.java is a method

    public void importTable(InputStream stream,
                            Object sender,
                            NSArray columnsToImport,
                            NSDictionary formatters,
                            String delimiter,
                            boolean skipFirstLine,
                            boolean shouldReplace)

that is close to what you want. It is intended to work with our Virtual Tables, not regular EOs, but would be a good starting point. You will see that we create the objects by getting EOF to create raw SQL Insert statements. If you are importing a lot of data this is needed for speed. EOF is not optimized for bulk inserts.

You can get these frameworks (source and binary) here:
http://sourceforge.net/projects/gvcsitemaker

HTH,

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/ practical_webobjects







_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Importing CSV into a WO application (From: Dev WO <email@hidden>)
 >Re: Importing CSV into a WO application (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Importing CSV into a WO application
  • Next by Date: WO developer position in Essen, Germany (newbies welcome)
  • Previous by thread: Re: Importing CSV into a WO application
  • Next by thread: command line WO Freeze - update
  • Index(es):
    • Date
    • Thread