Parsing CSV in java

后端 未结 9 1847
臣服心动
臣服心动 2020-11-27 21:12

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         


        
9条回答
  •  温柔的废话
    2020-11-27 22:07

    In order to get each value one at a time, use a StringTokenizer. Construct it with StringTokenizer(str, ","). (Not recommended)

    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).

提交回复
热议问题