Txt to xlsx

Description
Task to process text files to microsoft excel.

Quick steps:

  • download sample
  • generate content file (from pdf, docx, ...) and clean it:
    • check and convert file to system default encodage (UTF8 without bom on linux, ANSI on windows)
    • replace all '&' with 'AND'
    • add some 'EOL' to create new cells
  • create (or cut/paste) table of content file
  • run: ant txt2xlsx
  • open <file>.xlsx
  • select all and ajust columns (go to line automatically)

Txt to xlsx task parameters
Attribute Description Value Required
text the content file yes
toc the toc file, useful to split the content one no
bullettokens the tokens to split bullet lists •;o;*,... no
Examples
build.xml

<project name="txt2xlsx task"> 

  <taskdef name="txt2xlsx" 
	   classname="net.sourceforge.ant4x.biz.ms.Txt2XlsxTask" 
	   classpath="PATH/TO/ant4x.jar"/> 

  <target name="txt2xlsx"> 
    <txt2xlsx text="/path/to/file.txt"
              toc="/path/to/toc.txt" 
              bullettokens="•;o;*"/>
  </target> 

</project>  	
file.txt

TITLE1
TITLE1.1

Content A
* list item a
* list item b

TITLE1.2

Content B

TITLE2

Content C
  	
toc.txt

TITLE1
TITLE1.1
TITLE1.2
TITLE2