Kettle工具的使用

One :What is a kettle?
Kettle是一款国外免费且开源的ETL(Extract Transform Load)工具,纯 Java 编写,可以在Windows、Linux、Unix上运行,数据抽取高效稳定。
Kettle 中文名称叫水壶,该项目的主程序员MATT 希望把各种数据放到一个壶里,然后以一种指定的格式流出。
对于 Kettle ,主要是为了处理大量数据的抽取以及数据格式进行转换。比如:把一些比较乱的数据给抽取成一个 SQL 文件,接着把这个 SQL 文件给转换成 Excel 格式的文件。这就是 Kettle 的主要作用。
Kettle is a foreign free and open source ETL tool, written in pure Java, which can run on windows, Linux and UNIX, and the data extraction is efficient and stable.
Kettle is called kettle in Chinese. Matt, the main programmer of this project, hopes to put all kinds of data into a kettle and then flow out in a specified format.
For kettle, the main purpose is to extract a large amount of data and transform the data format. For example: extract some messy data into an SQL file, and then convert the SQL file into an excel file. That’s what kettle does.
1 | - 开源 broaden sources of income |
Two:How to install Kettle?
First –>Your computer environment must have the JDK.
Configuring the Java JDK environment is very simple, and I won’t demonstrate it here.

Second–>Installing Kettle
First of all you need to extract the following baidu net disk information
Link:https://pan.baidu.com/s/1JaeMz4xB9Ysq0V6iFfL3AQ
Extract the code:mpfy

When you’re done downloading, press the file somewhere. Then go to the data-integration directory and find the spoon.bat file. Double click to open it.

If you open the picture below, then congratulations, Kettle has been installed successfully and can be used.

Three:How to operate and use Kettle
First –> Let’s try Kettle
Now we have a TXT file. The contents of the TXT file are as follows:
1 | id,name,age,gender,province,city,region,phone,birthday,hobby,register_date |
Then we need to extract the data from this TXT file into an Excel table.

Second –> How do we do that?
To use Kettle for data processing, the first thing you need to do is build a data flow graph of Kettle, using visual operations like rows.Make a list of things to do in a wooden way.
<1>Create a new transformation

<2>Build the Kettle data flow diagram
1.Drag and drop the text file input from the input folder in the left core object into the middle white space.

2.Drag and drop the Excel output component from the output folder into the middle white space.

3.Hold down the Shift key and click on the text file input component, move the mouse to Excel output, and then release the mouse so that you can combine the two.The components are wired together.

<3>Configuration file text input component
1. Double-click the text file input component and click the “Browse” button in the pop-up window.

2. Select the TXT file to be converted


3.Be sure to click the Add button

4.Click the Content TAB, change the delimiter to a comma (note the comma of the English state), and change the encoding mode to: Utf-8.

5. Click the “Fields“ TAB, and then click the “Get Fields“ button, you can read all the fields in the TXT file.

6. Click the “Preview Record” button to see if Kettle can read the data in User.txt.

<4>Configure the Excel output component
1. Double-click the Excel output component and click the “Browse” button in the pop-up window.

2.Click the “Content” TAB, set the path to which you want to export the Excel file, and then click OK, and then delete the suffix xls.

3. Click the “Fields” TAB, and then click “Get Fields”.

<5>Save and start execution
1.Click the play button on the toolbar to start execution.


2.After the execution, we can go to the specified location, find the Excel file has been generated, you can see the contents inside.

