How to ignore first line of .txt when using Scanner class

前端 未结 3 833
太阳男子
太阳男子 2021-01-07 00:05

I have a text file that reads:

Description|SKU|Retail Price|Discount
Tassimo T46 Home Brewing System|43-0439-6|17999|0.30
Moto Precise Fit Rear Wiper Blade|0         


        
3条回答
  •  情歌与酒
    2021-01-07 00:18

    scanner.nextLine();
    while (scanner.hasNext()) {
          String row = scanner.nextLine();
          ....
    

提交回复
热议问题