Reputation: 3
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.
Upvotes: 0
Views: 3482
Reputation: 5976
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.
Upvotes: 1