Skip to content

Commit

Permalink
Merge pull request #110 from socrata/Map_fields
Browse files Browse the repository at this point in the history
Bug: Preview pipe delimited fields in the map fields dialog
  • Loading branch information
spaceballone committed Oct 26, 2015
2 parents 27a4eda + 2d6dcce commit ccff38d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/socrata/datasync/model/CSVModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ public void setValueAt(Object value, int row, int col){
public String getColumnPreview(int columnIndex, int itemsToPreview){
StringBuffer buf = new StringBuffer();
for (int i = 0; i < Math.min(itemsToPreview,getRowCount()); i++){
buf.append(getValueAt(i,columnIndex));
Object value = "N/A";
try
{
value = getValueAt(i,columnIndex);
}
catch (ArrayIndexOutOfBoundsException e){
System.out.println("Row contains different number of columns than expected. Rows with missing data will be displayed as \"N/A\" in the map fields dialog");
}
buf.append(value);
if (i+1 < Math.min(itemsToPreview,getRowCount()))
buf.append(", ");
}
Expand Down

0 comments on commit ccff38d

Please sign in to comment.