本篇的配置环境 https://www.jianshu.com/p/6c086c0ab2a9
mysql 8.0.27 ,python3.7 ,windows系统
一、文件准备
新建workJson 和 workfile 目录分别存放原始文件,和json
原始文件名file.txt
分割符为\t
二、txt文件到txt文件
- json模板获取
python D:\dataxTest\datax\bin\datax.py -r txtfilereader -w txtwriter > txtTotxtfile.json
- txtTotxt配置
{
"job": {
"content": [
{
"reader": {
"name": "txtfilereader",
"parameter": {
"column": [
{
"index": 0,
"type": "string",
"nullFormat":""
},
{
"index": 1,
"type": "string",
"nullFormat":""
},
{
"index": 2,
"type": "string",
"nullFormat":""
},
{
"index": 3,
"type": "string",
"nullFormat":""
}
],
"encoding": "utf-8",
"fieldDelimiter": "\t"