我有一個.csv文件,它具有逗號以及雙引號分隔值。如何使用帶有多個逗號和雙引號的掃描器在java中讀取.csv文件
現在我想解析逗號分隔值,當雙引號中有值時,我希望掃描儀使用雙引號作爲分隔符。
示例行解析:
123,學生 「考試的通知」, 「模式應該是一樣的,有效的,正確的」
現在我想分析它喜歡:
123 //comma seperated
student
exam notification //when "" it should be double quote separated
pattern should be same,validated,proper //ignore , comma in double quotes
代碼,我曾嘗試:
scanner.useDelimiter(",|\"");
因此,它可以同時使用,並且「」它確實很好,但在betwe它打印空白行,其中,「罷工,也不能忽略雙引號之間的逗號。
任何想法如何排序?
我想將CVS編輯爲CSV。但只有當超過6個字符改變時才允許編輯。你可以 - 發起人 - 編輯它? – realsim
它由csv thanx完成 – Shiv