au.com.bytecode.opencsv.CSVReader를 사용하여 CSV 파일을 읽고 모든 레코드를 하나씩 인쇄합니다. 코드가 이상하게 작동합니다. 초기 라인을 제대로 인쇄하고 있습니다. 그러나 그 후에는 한 줄로 여러 줄을 함께 인쇄합니다. 그런 다음 다시 다음 줄 집합을 올바르게 인쇄합니다. CSV 파일을 검사했는데 파일과 관련하여 문제가없는 것으로 나타났습니다. 적절한 형식 파서 (라인 엔딩, 탈출 등)을 구성하는 데 문제가있는 것처럼CSVReader가 여러 줄을 하나의 줄로 처리 중
Next line : [Line1 from the csv file]
Next line : [Line2 from the csv file]
Next line : [Line3 from the csv file]
Next line : [Line4 from the csv file]
Next line : [Line5 from the csv file]
Next line : [Line6 from the csv file]
Next line : [Line7 from the csv file]
Next line : [Line8 from the csv file]
Next line : [Line9 from the csv file
Line10 from the csv file
Line11 from the csv file
Line12 from the csv file
Line13 from the csv file
Line14 from the csv file
]
Next line : [Line15 from the csv file]
Next line : [Line16 from the csv file]
Next line : [Line17 from the csv file]
Next line : [Line18 from the csv file]
여기에 몇 가지 문제가있을 수 있습니다. 일부 CR/LF 문자가 누락 될 수 있습니다. – Techidiot
예. 선택 "\ r \ n"또는 "\ n"을 모든 줄의 줄 끝으로 사용하십시오. – gmaslowski
고맙습니다. 하지만 어떻게 확인해야합니까? –