Results 1 to 2 of 2
- 12-19-2008, 07:30 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 3
- Rep Power
- 0
Reading from csv file.plz help!!!!!!!!!!
Hi All
i am facing problem getting values from csv file.i want to read csv file line by line using an Array.Here is the code:
File file = new File("TestCaseDataRepository.csv");
BufferedReader bufRdr = new BufferedReader(new FileReader(file));
String line = null;
while((line = bufRdr.readLine()) != null)
{
String str[]=line.split(",");
for(int i=0;i<str.length;i++)
{
System.out.println(str[i]);
}
}
Now i want to read the fields in a particular line by using split()
Now the problem is if the particular field has values which is comma separated then it would also be separated as a different field.
what should i do??
Thanks in advance..:):)
- 12-19-2008, 07:41 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you show one your text line. Bit unclear what you rally want to split.
Similar Threads
-
help in reading file.
By wanw84 in forum New To JavaReplies: 2Last Post: 10-21-2008, 03:17 PM -
reading csv file help
By fritz1474 in forum New To JavaReplies: 5Last Post: 09-04-2008, 08:41 PM -
Right use of file reading ?
By jurka in forum New To JavaReplies: 3Last Post: 08-27-2008, 08:16 PM -
Reading a file for use
By peachyco in forum New To JavaReplies: 2Last Post: 11-27-2007, 03:49 AM -
Reading from a file
By leebee in forum New To JavaReplies: 1Last Post: 07-23-2007, 12:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks