Running replace function on entire flatfile

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

Posts: 10
Joined: Thu Apr 01, 2021 7:51 pm

Running replace function on entire flatfile

Postby Nismon8er » Wed Apr 28, 2021 7:02 pm

I am running DBWriter -> Reformat -> StructuredDataWriter .... this works fine

What I need to do after that is run FlatFileReader (on the resulting file from the StructuredDataWriter above) -> Reformat -> FlatFileWriter because I need to replace all instances of double single quotes '' to NULL but im not sure how to go about this since I always need metadata and im not sure what that will be if I want to do this for the entire file

If someone knows of another way to do this let me know

Posts: 2
Joined: Mon May 10, 2021 10:38 am

Re: Running replace function on entire flatfile

Postby szabol » Tue May 11, 2021 2:04 pm

Hello there!

I see two answers to your question.
In first one you only need FlatFileReader and FlatFileWriter.
1. Right click on FlatFileReader with linked file and select "Extract metadata"
2. Click "Next" and in "Quote character:" dropbox choose quotes and click "Finish"
3. In FlatFileWriter set "Quoted strings" attribute to "false"

When you run the graph data should be written now without the quotes.

Second solution utilizes "Reformat" component. There you read whole file as one record and use "replace" function
to get rid of the quotes.
1. Create new metadata with one field
2. Click on the record and delete values from "Record delimeter" and "Default delimeter"
3. Set "EOF as delimeter" in "Advanced" to true
4. In "Reformat" component use "replace" function
e.g. $out.0.field1 = replace($in.0.field1,"'","")

I've attached a file with above mentioned solutions so you can have a look.
(2.27 KiB) Downloaded 22 times
Ladislav Szabo
CloverCARE Support

Visit us online at