Solved

Migration Job Create Output File with line breaks

  • 6 May 2023
  • 3 replies
  • 236 views

Userlevel 2
Badge +6

Hi IFS Community,

does anyone have a solution to export csv file without line breaks?
I’ve seen topics about line breaks for data import but not for data export.

I guess we need to replace line breaks with IFS but I can’t do that with the procedure CREATE_OUTPUT_FILE.

There is no transformation option on FILE MAPPING tab.

Maybe we need to use a rule like CALLEXTPROC (Call external procedure after each row) but I didn’t found information about this.

If I have a solution to replace line breaks it will be possible to replace semicolons too and build a clean csv file.

Migration Job RULES tab

Thanks

icon

Best answer by Jens 8 May 2023, 07:49

View original

3 replies

Userlevel 4
Badge +8

Hi @ERPDMORENA 

you can use the REPLACE function in the column name (tab file FIle Mapping) of your CREATE_OUTPUT_FILE migration job.

 

e.g.

 

REPLACE(notes,CHR(13)||CHR(10),null) as notes_new)

notes=old field

notes_new=alias for your new field

CHR(13)=CR (Carriage Return)

CHR(10)=LF (Line Feed)

 

You must doble-check if CHR(13) and/or CHR(10) are the right values for your purpose please.

 

/Jens

Userlevel 2
Badge +6

Hi @Jens,

Thanks for your answer.

I added a new field with this formula and it’s working:

REPLACE(ERR_DESCR_LO, CHR(13) || CHR(10), '|')

I didn’t know it was possible to add formulas directly in the FILE MAPPING tab.
I will use this formula for all multiline fields and tab column separator to get a proper file (no way to enter a tab in IFS fields).

Column Name with formula

 

Userlevel 4
Badge +8

Hi @ERPDMORENA ,

good to hear that it works. If you need a TAB then you can try CHR(09)

 

/Jens

Reply