我设计了一个 servlet 来读取 CSV,并且我将 CSV 作为表单数据从邮递员传递,但我无法获得任何读取该数据的选项。
我试过下面的代码
String body = request.getReader().lines().collect(Collectors.joining());
我得到了一个巨大的字符串,但我不知道如何解析这个字符串。
----------------------------140780421327043896517058Content-Disposition: form-data; name="CSVfile"; filename="dummyDataSet.csv"Content-Type: text/csvID,Name ,Age,Address,State,Date,Salary1,Airi Satou,33,Tokyo,Tokyo,11/28/2008,"$162,700 "2,Angelica Ramos,47,London,London,10/9/2009,"$162,700 "3,Ashton Cox,66,San Francisco,San Francisco,1/12/2009,"$86,000 "4,Bradley Greer,41,London,London,10/13/2012,"$132,000 "5,Brenden Wagner,28,San Francisco,San Francisco,6/7/2011,"$206,850 "6,Brielle Williamson,61,New York,New York,12/2/2012,"$372,000 "7,Bruno Nash,38,London,London,5/3/2011,"$163,500 "8,Caesar Vance,21,New York,New York,12/12/2011,"$106,450 "9,Cara Stevens,46,New York,New York,12/6/2011,"$145,600 "10,Cedric Kelly,22,Edinburgh,Edinburgh,3/29/2012,"$433,060 "----------------------------140780421327043896517058--
你能帮我吗,如何读取CSV数据。
智慧大石
相关分类