Browse Source

first commit

master
李世鹏 2 years ago
commit
a3928061e2
  1. 16
      .idea/checkstyle-idea.xml
  2. 16
      .idea/compiler.xml
  3. 3
      .idea/copyright/profiles_settings.xml
  4. 20
      .idea/jarRepositories.xml
  5. 13
      .idea/libraries/Maven__commons_codec_commons_codec_1_10.xml
  6. 13
      .idea/libraries/Maven__org_apache_poi_poi_3_14.xml
  7. 13
      .idea/libraries/Maven__org_apache_poi_poi_ooxml_3_13.xml
  8. 13
      .idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_3_13.xml
  9. 13
      .idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_2_6_0.xml
  10. 13
      .idea/libraries/Maven__org_freemarker_freemarker_2_3_22.xml
  11. 13
      .idea/libraries/Maven__stax_stax_api_1_0_1.xml
  12. 93
      .idea/misc.xml
  13. 8
      .idea/modules.xml
  14. 6
      .idea/vcs.xml
  15. 694
      .idea/workspace.xml
  16. 5
      README.md
  17. 45
      pom.xml
  18. 64
      src/main/java/DocumentHandler.java
  19. 118
      src/main/java/ReadExcelTable.java
  20. 34
      src/main/java/WordTest.java
  21. 41
      src/main/java/excelToWord.java
  22. BIN
      target/classes/DocumentHandler.class
  23. BIN
      target/classes/ReadExcelTable.class
  24. BIN
      target/classes/WordTest.class
  25. BIN
      target/classes/excelToWord.class
  26. 22
      toWord.iml

16
.idea/checkstyle-idea.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>10.5.0</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds" />
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

16
.idea/compiler.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="toWord" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="toWord" target="1.7" />
</bytecodeTargetLevel>
</component>
</project>

3
.idea/copyright/profiles_settings.xml

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

20
.idea/jarRepositories.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

13
.idea/libraries/Maven__commons_codec_commons_codec_1_10.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: commons-codec:commons-codec:1.10">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.10/commons-codec-1.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.10/commons-codec-1.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.10/commons-codec-1.10-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/libraries/Maven__org_apache_poi_poi_3_14.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.poi:poi:3.14">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi/3.14/poi-3.14.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi/3.14/poi-3.14-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi/3.14/poi-3.14-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/libraries/Maven__org_apache_poi_poi_ooxml_3_13.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.poi:poi-ooxml:3.13">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi-ooxml/3.13/poi-ooxml-3.13.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi-ooxml/3.13/poi-ooxml-3.13-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi-ooxml/3.13/poi-ooxml-3.13-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_3_13.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.poi:poi-ooxml-schemas:3.13">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi-ooxml-schemas/3.13/poi-ooxml-schemas-3.13.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi-ooxml-schemas/3.13/poi-ooxml-schemas-3.13-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi-ooxml-schemas/3.13/poi-ooxml-schemas-3.13-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_2_6_0.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlbeans/xmlbeans/2.6.0/xmlbeans-2.6.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlbeans/xmlbeans/2.6.0/xmlbeans-2.6.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlbeans/xmlbeans/2.6.0/xmlbeans-2.6.0-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/libraries/Maven__org_freemarker_freemarker_2_3_22.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.freemarker:freemarker:2.3.22">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.22/freemarker-2.3.22.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.22/freemarker-2.3.22-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.22/freemarker-2.3.22-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/libraries/Maven__stax_stax_api_1_0_1.xml

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: stax:stax-api:1.0.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/stax/stax-api/1.0.1/stax-api-1.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/stax/stax-api/1.0.1/stax-api-1.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/stax/stax-api/1.0.1/stax-api-1.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>

93
.idea/misc.xml

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClientPropertiesManager">
<properties class="javax.swing.AbstractButton">
<property name="hideActionText" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JComponent">
<property name="html.disable" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JEditorPane">
<property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
<property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
<property name="charset" class="java.lang.String" />
</properties>
<properties class="javax.swing.JList">
<property name="List.isFileList" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JPasswordField">
<property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JSlider">
<property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
<property name="JSlider.isFilled" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTable">
<property name="Table.isFileList" class="java.lang.Boolean" />
<property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
<property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JToolBar">
<property name="JToolBar.isRollover" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTree">
<property name="JTree.lineStyle" class="java.lang.String" />
</properties>
<properties class="javax.swing.text.JTextComponent">
<property name="caretAspectRatio" class="java.lang.Double" />
<property name="caretWidth" class="java.lang.Integer" />
</properties>
</component>
<component name="EclipseCodeFormatter">
<option name="defaultSettings" value="true" />
<option name="formatter" value="ECLIPSE" />
<option name="id" value="1481770473877" />
<option name="importOrderConfigFilePath" value="$USER_HOME$/Downloads/eclipse-java-google-style.xml" />
<option name="importOrderFromFile" value="true" />
<option name="name" value="default" />
<option name="pathToConfigFileJava" value="$USER_HOME$/Downloads/eclipse-java-google-style.xml" />
<option name="selectedJavaProfile" value="GoogleStyle" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
</expanded-state>
<selected-state>
<State>
<id>Android</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/toWord.iml" filepath="$PROJECT_DIR$/toWord.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

694
.idea/workspace.xml

@ -0,0 +1,694 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="7982e4d6-b7f1-4915-90ab-430715a20d47" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/.idea/checkstyle-idea.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/WordTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/DocumentHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/DocumentHandler.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ReadExcelTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ReadExcelTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/excelToWord.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/excelToWord.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/DocumentHandler.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/DocumentHandler.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ReadExcelTable.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/ReadExcelTable.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/data.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/excelToWord.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/excelToWord.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/toWord.iml" beforeDir="false" afterPath="$PROJECT_DIR$/toWord.iml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/main/java/GetExcelInfo.java" />
<option value="$PROJECT_DIR$/src/main/java/ReadExcel.java" />
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/src/main/java/ReadExcelTable.java" />
<option value="$PROJECT_DIR$/src/main/java/DocumentHandler.java" />
<option value="$PROJECT_DIR$/src/main/java/excelToWord.java" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="$PROJECT_DIR$/../../maven" />
</MavenGeneralSettings>
</option>
</component>
<component name="MavenProjectNavigator">
<treeState />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="1336" />
<option name="y" value="-117" />
<option name="width" value="1432" />
<option name="height" value="966" />
</component>
<component name="ProjectId" id="2MSNSH08OqNwNzzrj3aK6I4e3Ya" />
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="toWord" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scratches" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="ProjectViewState">
<option name="showExcludedFiles" value="false" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/OW/新建文件夹/toWord&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/main/resources" />
</key>
</component>
<component name="RunManager" selected="应用程序.excelToWord">
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="EXTRA_OPTIONS" value="" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
</configuration>
<configuration default="true" type="ArquillianJUnit" factoryName="">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="arquillianRunConfiguration">
<value>
<option name="containerStateName" value="" />
</value>
</option>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="ArquillianTestNG" factoryName="">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="arquillianRunConfiguration">
<value>
<option name="containerStateName" value="" />
</value>
</option>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="Cold Fusion runner description" factoryName="Cold Fusion" custom_browser="" web_path="">
<method />
</configuration>
<configuration default="true" type="FlashRunConfigurationType" factoryName="Flash App">
<option name="BCName" value="" />
<option name="IOSSimulatorSdkPath" value="" />
<option name="adlOptions" value="" />
<option name="airProgramParameters" value="" />
<option name="appDescriptorForEmulator" value="Android" />
<option name="debugTransport" value="USB" />
<option name="debuggerSdkRaw" value="BC SDK" />
<option name="emulator" value="NexusOne" />
<option name="emulatorAdlOptions" value="" />
<option name="fastPackaging" value="true" />
<option name="fullScreenHeight" value="0" />
<option name="fullScreenWidth" value="0" />
<option name="launchUrl" value="false" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="/Applications/Flash Player Debugger.app" />
</LauncherParameters>
</option>
<option name="mobileRunTarget" value="Emulator" />
<option name="moduleName" value="" />
<option name="overriddenMainClass" value="" />
<option name="overriddenOutputFileName" value="" />
<option name="overrideMainClass" value="false" />
<option name="runTrusted" value="true" />
<option name="screenDpi" value="0" />
<option name="screenHeight" value="0" />
<option name="screenWidth" value="0" />
<option name="url" value="http://" />
<option name="usbDebugPort" value="7936" />
<method />
</configuration>
<configuration default="true" type="FlexUnitRunConfigurationType" factoryName="FlexUnit" appDescriptorForEmulator="Android" class_name="" emulatorAdlOptions="" method_name="" package_name="" scope="Class">
<option name="BCName" value="" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="/Applications/Flash Player Debugger.app" />
</LauncherParameters>
</option>
<option name="moduleName" value="" />
<option name="trusted" value="true" />
<method />
</configuration>
<configuration default="true" type="GrailsRunConfigurationType" factoryName="Grails">
<setting name="vmparams" value="" />
<setting name="cmdLine" value="run-app" />
<setting name="passParentEnv" value="true" />
<setting name="launchBrowser" value="true" />
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
<configuration default="true" type="JUnitTestDiscovery" factoryName="JUnit Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="TestNGTestDiscovery" factoryName="TestNG Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="osgi.bnd.run" factoryName="Run Launcher">
<method />
</configuration>
<configuration default="true" type="osgi.bnd.run" factoryName="Test Launcher (JUnit)">
<method />
</configuration>
<configuration name="GetExcelInfo" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="GetExcelInfo" />
<module name="toWord" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="ReadExcelTable" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ReadExcelTable" />
<module name="toWord" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="excelToWord" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="excelToWord" />
<module name="toWord" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java">
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="TEST_OBJECT" value="class" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
<option name="filePath" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="TestNG">
<option name="TEST_OBJECT" value="CLASS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<properties />
<listeners />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file enabled="true" id="idea.log" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="js.build_tools.gulp">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
<method v="2" />
</configuration>
<list>
<item itemvalue="应用程序.GetExcelInfo" />
<item itemvalue="应用程序.ReadExcelTable" />
<item itemvalue="应用程序.excelToWord" />
</list>
<recent_temporary>
<list>
<item itemvalue="应用程序.excelToWord" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7982e4d6-b7f1-4915-90ab-430715a20d47" name="Default" comment="" />
<created>1483688327034</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1483688327034</updated>
<workItem from="1483688330552" duration="21182000" />
<workItem from="1677757022843" duration="3833000" />
<workItem from="1677806745087" duration="2408000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="21182000" />
</component>
<component name="ToolWindowManager">
<frame x="1336" y="-117" width="1432" height="966" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32846716" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2895724" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33333334" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2381295" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="XDebuggerManager">
<watches-manager>
<configuration name="Application">
<watch expression="t" />
</configuration>
</watches-manager>
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/main/resources/data.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.20/freemarker-2.3.20.jar!/freemarker/template/Configuration.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="283">
<caret line="195" column="30" selection-start-line="195" selection-start-column="30" selection-end-line="195" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.20/freemarker-2.3.20.jar!/freemarker/cache/TemplateCache.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="615">
<caret line="86" column="0" selection-start-line="86" selection-start-column="0" selection-end-line="86" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.20/freemarker-2.3.20.jar!/freemarker/cache/ClassTemplateLoader.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="825">
<caret line="63" column="33" selection-start-line="63" selection-start-column="33" selection-end-line="63" selection-end-column="33" />
<folding>
<element signature="e#613#614#0" expanded="true" />
<element signature="e#662#663#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/freemarker/freemarker/2.3.20/freemarker-2.3.20.jar!/freemarker/cache/URLTemplateLoader.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="405">
<caret line="37" column="28" selection-start-line="37" selection-start-column="28" selection-end-line="37" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi/3.15/poi-3.15.jar!/org/apache/poi/ss/usermodel/Cell.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="46" column="8" selection-start-line="46" selection-start-column="8" selection-end-line="46" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/net/sourceforge/jexcelapi/jxl/2.6.12/jxl-2.6.12.jar!/jxl/Workbook.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="385">
<caret line="81" column="37" selection-start-line="81" selection-start-column="37" selection-end-line="81" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="23" selection-start-line="11" selection-start-column="23" selection-end-line="11" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/ReadExcelTable.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="61" column="48" selection-start-line="61" selection-start-column="48" selection-end-line="61" selection-end-column="48" />
<folding>
<element signature="n#!!doc" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/excelToWord.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="12" column="4" selection-start-line="12" selection-start-column="4" selection-end-line="12" selection-end-column="4" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/DocumentHandler.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="687">
<caret line="61" column="0" selection-start-line="61" selection-start-column="0" selection-end-line="61" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

5
README.md

@ -0,0 +1,5 @@
# toWord
此程序用于从Excel表中读取数据填到word模板中
详见[我的博客](http://www.jianshu.com/p/7dbb7d3e98ee)

45
pom.xml

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wuchangming.cn</groupId>
<artifactId>toWord</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
<packaging>jar</packaging>
<name>toWord</name>
<description>toWord</description>
<dependencies>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.22</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.13</version>
</dependency>
</dependencies>
</project>

64
src/main/java/DocumentHandler.java

@ -0,0 +1,64 @@
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import java.io.*;
import java.util.Map;
/**
* Created by wuchangming on 17/1/6.
*/
public class DocumentHandler {
private Configuration configuration = null;
public DocumentHandler() {
configuration = new Configuration();
configuration.setDefaultEncoding("utf-8");
}
public Template getTemplate() throws IOException {
configuration.setDirectoryForTemplateLoading(new File("C:\\Users\\Reborn\\Desktop"));
Template t = null;
try {
// data.xml为要装载的模板
t = configuration.getTemplate("test.xml");
t.setEncoding("utf-8");
} catch (IOException e) {
e.printStackTrace();
}
return t;
}
public Writer getWriter(String wordName){
String savePath = "C:\\Users\\Reborn\\Desktop\\";
File file = new File(savePath+"upload");
if(!file.exists()){
file.mkdirs();
}
File outFile = new File(savePath+"upload/"+wordName+".doc");
Writer out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(outFile), "utf-8"));
} catch (Exception e1) {
e1.printStackTrace();
}
return out;
}
public void createDoc(Template t,Map dataMap,Writer out) {
try {
t.process(dataMap, out);
out.close();
} catch (TemplateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}

118
src/main/java/ReadExcelTable.java

@ -0,0 +1,118 @@
/**
* Created by wuchangming on 17/1/6.
*/
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 读取上篇中的xls文件的内容并打印出来
*
* @author Administrator
*/
public class ReadExcelTable {
//通过对单元格遍历的形式来获取信息 ,这里要判断单元格的类型才可以取出值
public static List<Map> readTable() throws Exception {
Map map = new HashMap<String, String>();
List<Map> list = new ArrayList<Map>();
// map.put("308", "招商银行"); // 招行
// map.put("306", "广发银行"); // 广发
// map.put("303", "光大银行"); // 光大
// map.put("304", "华夏银行"); // 华夏
// map.put("105", "建设银行"); // 建行
// map.put("305", "民生银行"); // 民生
// map.put("103", "农业银行"); // 农行
// map.put("310", "浦发银行"); // 浦发
// map.put("309", "兴业银行"); // 兴业
// map.put("104", "中国银行"); // 中行
// map.put("302", "中信银行"); // 中信
// map.put("102", "工商银行"); // 工行
// map.put("301", "交通银行"); // 交行
// map.put("4105840", "平安银行"); // 平安
// map.put("403", "邮政储蓄银行"); // 邮储
InputStream ips = new FileInputStream("C:\\Users\\Reborn\\Desktop\\test.xlsx");
XSSFWorkbook wb = new XSSFWorkbook(ips);
Sheet sheet1 = wb.getSheetAt(0);
for (Row row : sheet1) {
String company = row.getCell(0).getStringCellValue();
String name = row.getCell(1).getStringCellValue();
row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
String identity = row.getCell(2).getStringCellValue();
row.getCell(3).setCellType(Cell.CELL_TYPE_STRING);
String time = row.getCell(3).getStringCellValue();
String things = row.getCell(4).getStringCellValue();
String personName = row.getCell(5).getStringCellValue();
row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
String date = row.getCell(6).getStringCellValue();
Map dataMap = new HashMap();
dataMap.put("company", company);
dataMap.put("name", name);
dataMap.put("identity", identity);
dataMap.put("time", time);
dataMap.put("things", things);
dataMap.put("personName", personName);
dataMap.put("shouquanren", name);
dataMap.put("date", date);
list.add(dataMap);
// for (Cell cell : row) {
// switch (cell.getCellType()) {
// case HSSFCell.CELL_TYPE_BOOLEAN:
// //得到Boolean对象的方法
// System.out.print(cell.getBooleanCellValue()+" ");
// break;
// case HSSFCell.CELL_TYPE_NUMERIC:
// //先看是否是日期格式
// if(HSSFDateUtil.isCellDateFormatted(cell)){
// //读取日期格式
// System.out.print(cell.getDateCellValue()+" ");
// }else{
// //读取数字
// System.out.print(cell.getNumericCellValue()+" ");
// }
// break;
// case HSSFCell.CELL_TYPE_FORMULA:
// //读取公式
// System.out.print(cell.getCellFormula()+" ");
// break;
// case HSSFCell.CELL_TYPE_STRING:
// //读取String
// System.out.print(cell.getRichStringCellValue().toString()+" ");
// break;
// default:
// System.out.println();
// }
//
// }
}
return list;
}
// //直接抽取excel中的数据
// public static void extractor() throws Exception{
// InputStream ips=new FileInputStream("d://test2-1.xls");
// HSSFWorkbook wb=new HSSFWorkbook(ips);
// ExcelExtractor ex=new ExcelExtractor(wb);
// ex.setFormulasNotResults(true);
// ex.setIncludeSheetNames(false);
// String text=ex.getText();
// System.out.println(text);
// }
}

34
src/main/java/WordTest.java

@ -0,0 +1,34 @@
import freemarker.template.Configuration;
import freemarker.template.Template;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
public class WordTest {
public static void genWord(){
try {
Map<String,String> dataMap = new HashMap<>();
dataMap.put("name", "张三");
Configuration configuration = new Configuration();
configuration.setDefaultEncoding("utf-8");
//.xml 模板文件所在目录
configuration.setDirectoryForTemplateLoading(new File("H:\\workFile\\genword\\template"));
// 输出文档路径及名称
File outFile = new File("H:\\workFile\\genword\\word\\test.doc");
//以utf-8的编码读取模板文件
Template t = configuration.getTemplate("test.xml","utf-8");
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"),10240);
t.process(dataMap, out);
out.close();
System.out.println("生成成功");
}catch (Exception e){
e.printStackTrace();
System.out.println("生成失败");
}
}
public static void main(String[] args) {
genWord();
}
}

41
src/main/java/excelToWord.java

@ -0,0 +1,41 @@
import freemarker.template.Configuration;
import freemarker.template.Template;
import java.io.*;
import java.util.List;
import java.util.Map;
/**
* Created by wuchangming on 17/1/6.
*/
public class excelToWord {
public static void main(String[] args) throws Exception {
personnelImportWord();
}
private static void personnelImportWord() throws Exception{
DocumentHandler dh = new DocumentHandler();
// Template t = dh.getTemplate();
List<Map> list=ReadExcelTable.readTable();
for (Map map : list){
// Writer out = dh.getWriter((String)map.get("name"));
// dh.createDoc(t,map, out);
Configuration configuration = new Configuration();
configuration.setDefaultEncoding("utf-8");
//.xml 模板文件所在目录
configuration.setDirectoryForTemplateLoading(new File("C:\\Users\\Reborn\\Desktop\\temp"));
// 输出文档路径及名称
File outFile = new File("C:\\Users\\Reborn\\Desktop\\"+map.get("name")+".doc");
//以utf-8的编码读取模板文件
Template t = configuration.getTemplate("test.xml","utf-8");
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"),10240);
t.process(map, out);
out.close();
System.out.println("生成成功");
}
}
}

BIN
target/classes/DocumentHandler.class

Binary file not shown.

BIN
target/classes/ReadExcelTable.class

Binary file not shown.

BIN
target/classes/WordTest.class

Binary file not shown.

BIN
target/classes/excelToWord.class

Binary file not shown.

22
toWord.iml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.22" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.14" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.13" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.13" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
</component>
</module>
Loading…
Cancel
Save