当前位置:网站首页>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
边栏推荐
- Pyppeter crawler
- JD-FreeFuck 京東薅羊毛控制面板 後臺命令執行漏洞
- Introduction to quantexa CDI syneo platform
- Re expression régulière
- Implement a simple function to calculate the sum of all integers between M ~ n (m < n)
- CISSP certified daily knowledge points (April 18, 2022)
- Rewrite four functions such as StrCmp in C language
- Dynamically add default fusing rules to feign client based on sentinel + Nacos
- re正則錶達式
- Jenkspy package installation
猜你喜欢
Re regular expression
Hard core parsing promise object (do you know these seven common APIs and seven key questions?)
MySQL auto start settings start with systemctl start mysqld
Docker installation MySQL
Qt读写XML文件(含源码+注释)
Dock installation redis
Deep learning classic network analysis and target detection (I): r-cnn
Resolves the interface method that allows annotation requests to be written in postman
MATLAB从入门到精通(二)
Gobang game based on pyGame Library
随机推荐
【ACM】509. Fibonacci number (DP Trilogy)
Use of regular expressions in QT
xlsxwriter. exceptions. Filecreateerror: [errno 13] permission denied
Flash - Middleware
word frequency count
Implement a simple function to calculate the sum of all integers between M ~ n (m < n)
Custom prompt box MessageBox in QT
Re regular expression
Daily network security certification test questions (April 12, 2022)
A few lines of code teach you to crawl lol skin pictures
由tcl脚本生成板子对应的vivado工程
How to install jsonpath package
QT reading and writing XML files (including source code + comments)
Mode of interprocess communication
Batch export ArcGIS attribute table
Cygwin64 right click to add menu, and open cygwin64 here
线上怎么确定期货账户安全的?
Rust: how to implement a thread pool?
Quantexa CDI(场景决策智能)Syneo平台介绍
MySQL auto start settings start with systemctl start mysqld