/** * 处理excel将下标转换为ABCD列,将下标转换为字母,调用该方法时必须+1;例:String columnNumber = getIndexWord(0+1);columnNumber=A; * @Title: getIndexWord * @author hegg * @date 2020年1月1日 下午8:59:14 * @return 返回类型 String * @param */ public static String getIndexWord(Integer i){ String[] word = new String[]{"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; int d = i/26; int x = i%26; String w = ""; if(x == 0){ if(d>1){ w= word[d-2] + "" + word[25]; } else { w = word[i-1]; } } else { if(d>=1){ w= word[d-1] + "" + word[x-1]; } else { w = word[x-1]; } } Map<Integer, String> a = new LinkedHashMap<Integer, String>(); a.put(i, w); return a.get(i); }