44 |
BufferedReader br1 = new BufferedReader(isr1) |
BufferedReader br1 = new BufferedReader(isr1) |
45 |
) { |
) { |
46 |
String line = br1.readLine(); |
String line = br1.readLine(); |
47 |
|
|
48 |
|
if (line == null) { |
49 |
|
throw new IOException("Can't read 1st line - is file empty?"); |
50 |
|
} |
51 |
|
|
52 |
String[] parts = line.split(";"); |
String[] parts = line.split(";"); |
53 |
int numFields = parts.length; |
|
54 |
if (numFields != 13) { |
if (parts.length != 13) { |
55 |
throw new IOException("Not enough fields in CSV file. Found " + numFields + ", expected 13"); |
throw new IOException("Not enough fields in CSV file. Found " + parts.length + ", expected 13"); |
56 |
} |
} |
57 |
} |
} |
58 |
|
|