Results 1 to 8 of 8
- 05-22-2008, 06:01 AM #1
Member
- Join Date
- May 2008
- Posts
- 3
- Rep Power
- 0
- 05-22-2008, 06:11 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Are looking to parse it through JDBC?
- 05-22-2008, 06:20 AM #3
Member
- Join Date
- May 2008
- Posts
- 3
- Rep Power
- 0
HI
No,Using Java.io package and validations also need
- 05-22-2008, 06:35 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, simply read the file as a normal text file. Got it?
- 05-22-2008, 07:30 AM #5
Read the file line by line (readLine()) and parse each line with StringTokenizer for commas(,) :)
Daniel @ [www.littletutorials.com]
Language is froth on the surface of thought
- 05-22-2008, 07:37 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yep, that's what I try to explain him. But no feedback there. He just looking a code. I don't like to just give a code. Why they don't try something. :) ;(
- 05-22-2008, 06:36 PM #7
Member
- Join Date
- May 2008
- Posts
- 3
- Rep Power
- 0
HIIIIII Eranga
Thanks for ur support.pls send the code if u have any possible,pls share the code.I was tried whole day.but i didn`t get any proper output.
- 05-23-2008, 03:46 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
OK try this, a part of it. Read a file and get each line of it. I give a part of it, because best thing is try something yourself and ask here if you stuck. Anyway,
In this way you can read each line of the file. Then think that how to separate data depend on the comma( , ) there are lots of way to do it. :)Java Code:FileReader myFile = new FileReader(path_to_CSV_file); BufferedReader InputFile = new BufferedReader(myFile); // Read the first line String currentRecord = InputFile.readLine(); while(currentRecord != null) { // Do the record validation here // Important: get the next record. currentRecord = InputFile.readLine(); }
Similar Threads
-
A utility class that parses a Comma Separated Values (CSV) file
By Java Tip in forum java.ioReplies: 0Last Post: 04-16-2008, 10:58 PM -
Reading Float values from a file
By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 09:20 AM -
reading values from config file
By sathish_2111 in forum Enterprise JavaBeans (EJB)Replies: 3Last Post: 08-10-2007, 03:09 PM -
how to validate a xml file with schemas via SAX
By oregon in forum XMLReplies: 3Last Post: 08-01-2007, 05:15 PM -
how to parse an xml file
By oregon in forum XMLReplies: 3Last Post: 08-01-2007, 04:53 PM


LinkBack URL
About LinkBacks

Bookmarks