Convert several rows into one field

Hello,
I import a large log-file that contains some rows starting with the string ‘CURRENTPHASE’. I’d like to combine all following rows down to the next row starting with ‘CURRENTPHASE’ into one column/field (concat all rows with some delimiter like ‘///’) that I then assign to the row showing ‘CURRENTPHASE’.

Is anyone able to show me how to achieve this?

The text file looks like this:
[…]
CURRENTPHASE MOD_SELROADMAP/SELECT_ROADMAP
…started at 20251023145147

Using phase log file ‘SELROADMAP.LOG’.

…begin dialog at 20251023145148
…end dialog at 20251023145223
…begin dialog at 20251023145223
…end dialog at 20251023145227
…begin dialog at 20251023145227
…end dialog at 20251023145232
…begin dialog at 20251023145232
…end dialog at 20251023145239

Resource usage: self 0.1/ 0.0/15MB usr/sys/mem, children 0.1/ 0.0/50MB usr/sys/mem.

…finished at 20251023145239 with status SUCCEEDED.
CURRENTPHASE MOD_SELROADMAP/CONFCHK_STACK
…started at 20251023145239

Using phase log file ‘CONFCHK_KRNL.LOG’.

Current Operating System (OS) Configuration:

Resource usage: self 0.0/ 0.0/15MB usr/sys/mem, children 0.0/ 0.0/50MB usr/sys/mem.

…finished at 20251023145239 with status SUCCEEDED.
CURRENTPHASE MOD_SELROADMAP/DBCONNCHK_PRE
…started at 20251023145239

Using phase log file ‘PHASE_DBCONNCHK.LOG’.

Resource usage: self 0.0/ 0.0/15MB usr/sys/mem, children 0.0/ 0.0

[…]

Thanks for your help.
Best regards
Alex

Maybe this helps:

RowConcat.transform (3.4 KB)

The challenge is the Concat Cols, as the number of columns can change and in the consequence the Remove Cols. An option would be to create dummy with a potential max of rows and stack it with the real log file to stabilize the column number and remove such duty row later on with a filter. Otherwise the 2 last transformations need to be checked manually with each execution.

Here is a way you can do it, using Unique, that should work regardless of the number of rows following each CURRENTPHASE.

image

RowConcat2.transform (3.4 KB)

1 Like

@Admin for sure you have a better solution :+1: , evenso I used unique with the concat, but it came not to my mind thinking on the request

1 Like

@AlexTarpay have a look to the “Concat delimiter” field in the unique transformation, where you can set an appropriate value.

1 Like

Thank you both, Admin and Olaf, that’s exactly what I wanted. Great!

1 Like