+ /**
+ * See if a field looks numeric or not by comparing the number of numeric vs non-numeric characters
+ * @param inValue field value to check
+ * @return true if there are more numeric characters than not
+ */
+ private static boolean fieldLooksNumeric(String inValue)
+ {
+ if (inValue == null) {
+ return false;
+ }
+ final int numChars = inValue.length();
+ if (numChars < 3) {return false;} // Don't care about one or two character values
+ // Loop through characters seeing which ones are numeric and which not
+ int numNums = 0;
+ for (int i=0; i<numChars; i++)
+ {
+ char currChar = inValue.charAt(i);
+ if (currChar >= '0' && currChar <= '9') {numNums++;}
+ }
+ // Return true if more than half the characters are numeric
+ return numNums > (numChars/2);
+ }
+