简体   繁体   中英

Pentaho Kettle, find replace in text file

I am trying to read a text file and replace all occurrence of a "search term" with "replace term" with regular expression and write the new file.

I am relatively new to pentaho kettle and not sure which transform or set of steps will suite best for this use case? Most transforms read data by rows or columns so I am not sure how to read a text file and do a find replace to work? Most transforms either file line by line or by fields.

Thanks for time and attention.

Step 1 - Input-> Text file input : file type: Fixed, just one String field big enough

Step 2 - Transform -> Replace in String : Use regexp: Y, Find: "search term", Replace: "replace term"

Step 3 - Output -> Text file output

Not sure it's the best, but it works. Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM