当前位置:网站首页>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
边栏推荐
- JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability
- 【ACM】376. Swing sequence
- Mysqldump backup database
- 消费者灰度实现思路
- Flash operates on multiple databases
- 函数递归以及趣味问题的解决
- How to install jsonpath package
- Robocode tutorial 5 - enemy class
- Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
- Crawler for querying nicknames and avatars based on qqwebapi
猜你喜欢

Robocode tutorial 3 - Robo machine analysis

深度学习经典网络解析目标检测篇(一):R-CNN

MATLAB从入门到精通(二)

JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability

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

Cygwin64 right click to add menu, and open cygwin64 here

Introduction to quantexa CDI syneo platform

QT add external font ttf

WiFi ap6212 driver transplantation and debugging analysis technical notes

【ACM】376. 摆动序列
随机推荐
Imx6 debugging LVDS screen technical notes
Scikit learn sklearn 0.18 official document Chinese version
Climbing watermelon video URL
QT tablewidget insert qcombobox drop-down box
Arcpy adds fields and loop assignments to vector data
MySQL auto start settings start with systemctl start mysqld
软件测试总结
Cells in rust share variable pointers
Rust: how to match a string?
What are the relationships and differences between threads and processes
kettle庖丁解牛第17篇之文本文件输出
Robocode tutorial 8 - advanced robot
线上怎么确定期货账户安全的?
Solution to Chinese garbled code after reg file is imported into the registry
Nodejs安装
Closure type of rust (difference between FN, fnmut and fnone)
CISSP certified daily knowledge points (April 18, 2022)
Crawl the product data of cicada mother data platform
Visualization of residential house prices
Box pointer of rust