1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import java.nio.charset.Charset; import com.csvreader.CsvReader; public class Test { public static void main(String[] args) throws Exception { CsvReader csv = new CsvReader("file.csv", ';', Charset.forName("UTF-8")); csv.readHeaders(); while( csv.readRecord() ) { String name = csv.get("name"); String surname = csv.get("surname"); System.out.println("name=" + name + ", surname=" + surname); } csv.close(); } } |
1 2 3 |
name;surname Pedro;Díaz Marta;Sanz |
Liberia: