⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findarraytoexcel.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
package net.aetherial.gis.test.tools.bian1;

import net.aetherial.gis.jiaotongbu.input.analyse.OpenDirect;
import net.aetherial.gis.surface.ItemValue;
import java.io.File;
import net.aetherial.gis.table.WuWei;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class FindArrayToExcel {
  private WuWei ww = null;
  private String xianName = "";
  public FindArrayToExcel() {
  }

  public void readArray(String inputPath) {
    OpenDirect od = new OpenDirect();
    ItemValue.setArrayPath(od.getArrayPath(inputPath));
    ww = new WuWei();
  }

  public void readExcel() {
    ReadBianmaBiao read = new ReadBianmaBiao(
        "C:\\Documents and Settings\\Administrator\\桌面\\编码\\1004.xls");
//      "C:\\Documents and Settings\\Administrator\\桌面\\编码\\6.xls");
    read.read();
  }

  public ShiXianXiangCun[] getShiXianXiangCun(){
    ShiXianXiangCun[] temp = new ShiXianXiangCun[Permanence.shixianxiangcun.size()];
    Permanence.shixianxiangcun.copyInto(temp);
    return temp;
  }

  public void compare() {
    ShiXianXiangCun record = null;
    for (int i = 0; i < Permanence.shixianxiangcun.size(); i++) {
      record = (ShiXianXiangCun) Permanence.shixianxiangcun.get(i);
      if (this.getShortName(this.xianName).equals(this.getShortName(record.getXianName()))) {
        record = this.getNewShiXianXiangCun(record);
      }
    }
  }

  private ShiXianXiangCun getNewShiXianXiangCun(ShiXianXiangCun record){
    for (int i = 0; i < this.ww.wuchen_xiangzhen.length; i++) {
      if (this.getShortName(this.ww.wuchen_xiangzhen[i]).equals(this.getShortName(record.getXiangName()))) {
        if (this.getShortName(this.ww.wuwei_cun[i]).equals(this.getShortName(record.getCunName()))) {
          record.setArrayXiangzhen(this.ww.wuchen_xiangzhen[i]);
          record.setArrayCun(this.ww.wuwei_cun[i]);
          return record;
        }
      }
    }

    for (int i = 0; i < this.ww.wuchen_xiangzhen.length; i++) {
      if (this.getShortName(this.ww.wuwei_cun[i]).equals(this.getShortName(record.getCunName()))) {
          record.setArrayXiangzhen(this.ww.wuchen_xiangzhen[i]);
          record.setArrayCun(this.ww.wuwei_cun[i]);
          return record;
        }
    }
    return record;
  }

  public void createFile(){
    String n = "";
    ShiXianXiangCun record = null;
    for (int i = 0; i < Permanence.shixianxiangcun.size(); i++) {
      record = (ShiXianXiangCun)Permanence.shixianxiangcun.get(i);
      n += record +"\r\n";
    }
    ScanToData.createLogFile(n);
  }
  private String getShortName(String name){
    if (name.length() >2) {
      name = name.substring(0,2);
    }
    return name;
  }
  public static void main(String args[]) {
    FindArrayToExcel ftw = new FindArrayToExcel();
    ftw.readExcel();



    OpenDirect od = new OpenDirect();
//    System.out.println(od.getArrayPath(""));
    String path = "";
    File parent = new File("E:\\农村公路通达情况调查\\数据\\报部数据\\安徽省\\");
    File[] children = parent.listFiles(), c2;
    for (int i = 0; i < children.length; i++) {
      if (! (children[i].getName().indexOf("汇总") != -1 ||
             children[i].getName().indexOf("svn") != -1)) {
//          path = children[i].getAbsolutePath();
//          path = path.replaceAll('\\',"\\\\");
        c2 = children[i].listFiles();

        for (int j = 0; j < c2.length; j++) {
          if (! (c2[j].getName().indexOf("汇总") != -1 ||
                 c2[j].getName().indexOf("svn") != -1)) {
            path = c2[j].getAbsolutePath();
            System.out.println("od.getArrayPath(\"" + path + "\") == ");
            System.out.println(od.getArrayPath(path));
            ftw.setXianName(c2[j].getName());
            ftw.readArray(path);
            ftw.compare();
          }

        }

      }
    }



    ftw.createFile();
//    System.out.println(od.getArrayPath(
//        "E:\\农村公路通达情况调查\\数据\\报部数据\\安徽省\\黄山市\\祁门县"));
  }

  public void setXianName(String xianName) {
    this.xianName = xianName;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -