From: Aram Mirzadeh <aram...@gmail.com>
Date: Thu, 20 Jan 2011 00:23:23 -0500
Local: Thurs, Jan 20 2011 12:23 am
Subject: Re: [CSVChat] Re: Odd problem with linux code
Oh I didn't realize that was still in there when I copied and pasted the Yes that was just a test, as the problem was working in Windows and not in I did have it set to \r as the end record. That doesn't seem to fix the Aram On Wed, Jan 19, 2011 at 9:31 PM, shriop <shr...@hotmail.com> wrote: -- > You're doing some odd things with the line separators and apparently > have some odd line separators in the file. The point of > System.getProperty("line.separator") is that it returns different > values on different operating systems. In Windows, that should return > \r\n, of which you're only grabbing \r for some odd reason. In Linux, > that should return just \n. So I would expect you to get the result > you're getting if the file is \r record delimited and has \n's in the > data of your multiline record. If this file is always going to be in > this format, so always \r record delimited and only having \n's in the > data, then just set the RecordDelimiter property to \r always instead > of having it change based on the operating system, and then it should > at least work the same in both environments. > Bruce Dunwiddie > On Jan 19, 8:05 pm, Aram <aram...@gmail.com> wrote: > > I have: > > reader.setSkipEmptyRecords(true); > reader.setRecordDelimiter(System.getProperty("line.separator").charAt(0)); > > The csv is | delimited, with ^M at the end of the record. > > Here is the record in question, this is all one record > > 2305|Universiteit Leiden|xxxx > > In windows the insert statement is built without issue, in Linux: > > 20:58:55,237 DEBUG Feed:151 - INSERT INTO `DDD` ('2305','Universiteit > > Exception in thread "main" java.lang.NumberFormatException: For input > java.lang.NumberFormatException.forInputString(NumberFormatException.java: > > Any ideas? > -- Aram Mirzadeh a...@TranquilPhotos.com Phone: (631) 627-1236 Sports, Events, Fine Art Photography You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||