This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
spring_batch [2014/03/05 10:13] mihael |
spring_batch [2015/03/17 08:38] (current) mihael |
||
---|---|---|---|
Line 83: | Line 83: | ||
</beans:bean> | </beans:bean> | ||
</sxh> | </sxh> | ||
+ | |||
+ | ==== Tab Delimited Values ==== | ||
+ | To declare the tab character as a delimiter "\t" cannot be specified. Instead use the Java constant from the Spring framework. | ||
+ | |||
+ | <sxh xml> | ||
+ | <beans:property name="lineTokenizer"> | ||
+ | <beans:bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"> | ||
+ | <!-- field delimiter of your csv file --> | ||
+ | <beans:property name="delimiter"> | ||
+ | <util:constant static-field="org.springframework.batch.item.file.transform.DelimitedLineTokenizer.DELIMITER_TAB"/> | ||
+ | </beans:property> | ||
+ | </beans:bean> | ||
+ | </beans:property> | ||
+ | </sxh> | ||
+ | |||
+ | Don't forget to add the namespance to the head of the xml file. | ||
+ | |||
+ | <sxh xml> | ||
+ | <beans:beans xmlns:beans="http://www.springframework.org/schema/beans" | ||
+ | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc" | ||
+ | xmlns:batch="http://www.springframework.org/schema/batch" | ||
+ | xmlns:util="http://www.springframework.org/schema/util" | ||
+ | xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" | ||
+ | xsi:schemaLocation=" | ||
+ | http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.2.xsd | ||
+ | http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | ||
+ | http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd | ||
+ | http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd | ||
+ | http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> | ||
+ | </sxh> | ||
+ | |||
+ | |||
===== Create Jar with Dependencies ===== | ===== Create Jar with Dependencies ===== |