当前位置:网站首页>Kettle paoding jieniu Chapter 17 text file output
Kettle paoding jieniu Chapter 17 text file output
2022-04-23 18:20:00 【Feige big data】
introduction
in front 16 In this article , We introduce some common input components in detail . Start with this article , We mainly talk about the output components .
In this article , Our main explanation is :kettle Text file output in .
transformation
transformation (transaformation) yes ETL The main part of the solution , It handles extraction 、 transformation 、 Loading various operations on data lines .
Create transformations
What we have to do ETL operation , It's all designed in transformation , So we need to create a transformation first .


Save conversion

Give you a new conversion , Name it , And save


Text file output
Through this component , Output the data stream to a text file and save .


a、 The file name specifies
1、 Document labels , Specify which file the output data is saved to locally , Click on “ Browse ” Button , Browse local disk location , Then hand write txt file name .




2、 Option description
Options |
describe |
File name |
Output file name . |
Output passed to servlet |
After checking , All outputs will be directed to Servlet Character output stream , Instead of persistent files . You can imagine that the contents of the file are redirected to a... On the server side Web Address . And the conversion using this step , May be through Carte perhaps DIServer Remote service to start , In this way, the execution container of the transformation becomes a Servlet, All the output from this step will be redirected to this Servlet In the character output stream of . |
Create parent directory |
When checked, it will be based on “ File name ” The parent directory is automatically created by the path in |
Do not create files at startup |
If checked, the file will not be generated at the beginning of conversion . |
Get the file name from the field |
Use the... In the input stream 7 Controls “ File name field ” The data in is used as the output file name , Check the... Below “ File name field ” Will become optional . |
File name field |
Specifies the field in the input stream that contains the file name . |
Extension |
Specifies the extension of the output file name . |
The file name contains the number of steps |
When the output step is set to multi-threaded execution , Is automatically generated from “0” Step number to start counting . |
The file name contains the data area code |
If you check the , When using partition mode in the current step , The file name contains the name of the partition ID. |
The file name contains the date |
Check this box , The generated file name will contain the year 、 month 、 Japan . |
The file name contains the time |
Check this box , When the generated file name contains 、 branch 、 second . |
Specify the date time format |
After checking , Control “ Date time format ” Will become available , And generate the file name suffix according to the selected date format . |
Date time format |
Time format drop-down box , The file name suffix... Will be generated according to the selected format . |
Show filename |
Preview the generated file name . |
Add file name to the result |
Check this box , The file name of the conversion result can be saved into the stream , So that it can be obtained in subsequent steps . |
b、 The content specified

Option description
Options |
describe |
append mode |
Whether to append a line at the end of the specified file . |
Separator |
Specifies the character that separates the field in the text , for example ; Or tabs . |
Closure |
A pair of characters that enclose a field . Optional . |
Force a closing character around the field |
Enclose both sides of each column of data |
Disable closure repair |
Disable closure repair |
Head |
If you want to have a head line , Make this option available ( The first line of the document ). |
The tail |
If you want to have a tail line , Make this option available ( The last line of the document ). |
Format |
DOS perhaps UNIX.UNIX The file line separator is a newline character .DOS The file can be a line feed or carriage return . |
Compress |
Specify the type of compression (zip perhaps gzip). |
code |
Specifies the encoding used by the file . If it is blank, use the system default code . |
Field right fill or crop |
Add a space or delete a character at the end of the field , Until the length reaches the specified . |
Fast data storage ( Unformatted ) |
When processing large amounts of data into a text file , Improve performance .( Does not contain any formatting information ). |
Spin off … Every line |
If N Than 0 Big , use N Line split text file , Split into multiple parts . |
Add end of file line |
Specify the end line of the output text . |
c、 Field
Set the fields to export .

Below is a list of options for the tag
Options |
describe . |
name |
Set the name of the field to be displayed in the output stream . |
type |
Field type (String、Date、Number etc. ). |
Format |
Controls the format of input data ( Integers 、 There are decimal places 、 Date format, etc ) |
length |
about Number: Number of significant numbers . about String: The length of the characters . about Date: The length of the printout character ( for example 4 Represents the year of return ). |
precision |
about Number: Number of floating point numbers . about String,Date,Boolean: not used . |
currency |
Used to explain, for example $10,000.00 The number of . |
decimal |
The decimal point can be ”.”(10;000.00) perhaps ”,”(5.000,00). |
grouping |
Grouping can be ”.”(10;000.00) perhaps ”,”(5.000,00). |
Remove empty string mode |
Empty before processing . |
Null |
How to deal with null values . |
Okay , About each tab of the text file output component , I explained as much as I could . In fact, in my daily work , Not used so much , There are a few commonly used . But in the process of our study , I'd better speak more fully , I hope you spend time studying , Try to have a general understanding . Let's take an example to operate , This is a better way to absorb and understand .
Actual demonstration
We're going to demonstrate from excel The data is read from the file , Then output the component through a text file , Finally save the data in txt In file
a、 establish excle file
I am here D Under the plate , Create a xlsx file , Name it bigdata. stay sheet1 Design data in , The first 1 Line is the header of the file , From 2 The line starts with data , This file has 2 Column data ..

b、 Create transformations

c、Excel Enter Settings
increase Excel File as data source




Specify the worksheet


Specified field


d、excle Data preview record



e、 Text file output component

Use the left mouse button to click Excel Input components , Hold down shift key , from Excel Input components Drag and drop to Text file output Components , The effect after dragging is shown in the figure below :

f、 Text file output settings



h、 Run the transformation




i、 Verification result file

Conclusion
This article mainly explains : Various detailed settings of text file output component , Finally, the actual combat demonstrates , from excel The data is read from the file , Then output the component through a text file , Finally save the data in txt In file .
brothers , In fact, there is a distance between thinking and acting , If you think about it, it's gone , But you're doing it , It landed .
Don't say anything , Brothers, follow me and it's over , We still break up the way of kneading to say . The following content is more wonderful , Coming soon , Thank you for your attention !!
版权声明
本文为[Feige big data]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231719565929.html
边栏推荐
- Ionic 从创建到打包指令集顺序
- 【ACM】70. climb stairs
- idea中安装YapiUpload 插件将api接口上传到yapi文档上
- 解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
- 解决允许在postman中写入注释请求接口方法
- Docker 安装 MySQL
- Pyppeter crawler
- WIN1 remote "this may be due to credssp encryption Oracle correction" solution
- Hard core parsing promise object (do you know these seven common APIs and seven key questions?)
- Selenium + webdriver + chrome realize Baidu to search for pictures
猜你喜欢

Robocode tutorial 3 - Robo machine analysis

Solution to Chinese garbled code after reg file is imported into the registry

JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability

Dynamically add default fusing rules to feign client based on sentinel + Nacos

C medium? This form of

Calculation of fishing net road density

Closure type of rust (difference between FN, fnmut and fnone)

解决允许在postman中写入注释请求接口方法

re正則錶達式

Creation and use of QT dynamic link library
随机推荐
re正則錶達式
Interpretation and compilation of JVM
Const keyword, variable and function are decorated with const
Imx6 debugging LVDS screen technical notes
SQL database syntax learning notes
多功能工具箱微信小程序源码
logstash 7. There is a time problem in X. the difference between @ timestamp and local time is 8 hours
QT reading and writing XML files (including source code + comments)
JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability
Docker 安装 Redis
word frequency count
线上怎么确定期货账户安全的?
Resolve the error Max virtual memory areas VM max_ map_ count [65530] is too low, increase to at least [262144]
【ACM】70. 爬楼梯
Mysql database backup command -- mysqldump
Solving the problem of displaying too many unique values in ArcGIS partition statistics failed
The vivado project corresponding to the board is generated by TCL script
Spark performance optimization guide
串口调试工具cutecom和minicom
Multifunctional toolbox wechat applet source code