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

前端 未结 3 839
太阳男子
太阳男子 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:12

    Simply calling scanner.nextLine() once before any processing should do the trick.

提交回复
热议问题