Multi Repeating Line Text file Transformation

Hi,
EasyMorph Community! Thanks in advance for your help!!
I am have a database that has been dumped to a text file. Each record is made up of 12 rows and each of those rows has delimited text. The file is just one big column with multiple records stacked on top of each other.
The columns are not fixed length (ie each of the 12 rows vary in length).
I don’t think I can use a custom delimiter because their are line breaks in each individual record.
The number or records in a file is variable so it doesn’t seem like using unpivot would work.
I have attached a sample record.
Thanks

sample iphone db.txt (3.1 KB)

Hey @Kevin, how would you like the end result to look like? Can you put a couple of these records in the desired format in an Excel and attach it here?

Thanks

I have prepared the spreadsheet as asked and by doing so have realized that the records don’t have a fixed number or rows as I thought. So it will be a bit trickier to extract the field names than I had thought.
Transformed iphone sample db.xlsx (12.5 KB)
Thanks in advance for the help!!

Hello @Kevin, what do you mean that “the records don’t have a fixed number or rows”? Can you provide an example? Thanks

Multi Repeating Line Text file Transformation.morph (8.6 KB)

Hi,

This should help.
put your source file in the same directory than the morph file.
On step 4 you can rename your fields within the rules transformation.
If you can’t do it with EM, you just can’t do it…

Regards

2 Likes

Hi @cvo,

Thanks for the morph. I can understand the logic and can see that it should work but the data never loads in the first step despite the fact that it successfully does a preview of the data converted into a single column table.

Not sure if this could be the cause but I created a new folder in the examples directory and dragged the files into it. I can open the morph and see the data file in preview when I click on it in the new folder but nothing more. When I try to open the project from the start project tab I can an WasyMorph message saying that an error occured and that it could not find the morph file. I have erased and re deposited the files but the error persists.

The Example DB is still in the AppData folder on my harddrive so that this is probably not a MS Onedrive issue.

What does seem to be a commonality is that all the projects with text files seem to run into the same issue in terms of launching from the Start Tab. However, they all work when started by clicking on the morph file in the explorer window.

Any ideas on what is causing this?

Hey @Kevin and @cvo I looked at the Morph attached by @cvo and it seems that the table is collapsed.

Click here:

That displays the table.

1 Like

Worked like a charm!!! Thanks

@cvo, a great solution! Clean, concise, and idiomatic.

That’s all folks…