I have this weird situation where I have to read horizontally. So I am getting a csv file which has data in horizontal format. Like below:
CompanyName,RunDat
In order to get each value one at a time, use a StringTokenizer. Construct it with (Not recommended)StringTokenizer(str, ",")
.
Use the split()
method of the string class, which loads all of the tokens into an array.
Use the DateFormat class to parse each date -- specifically DateFormat.parse(String)
.