Skip to main content

Hi,

I'm downloading a bunch of text files from an FTP server and the contents of each file is stored in an attribute. The format of a text file is as follows :

Station1;2022-04-12;09:00;Var1;True;30.4;Var2;True;0.5;Var3;False;0.0;

Station2;2022-04-12;08:00;Var1;True;33.4;Var2;True;0.5;Var4;True;10.3;

Station3;2022-04-12;09:00;Var1;True;27.4;Var3;True;0.5;

 

What I would like to do is transform this text to a table as in the attached screenshot, but I have not found any easy way to do it in FME. Would you have any suggestions?

 

Thanks!

Screen Shot 2022-05-17 at 12.12.18 AM 

If it's stored in an attribute you can use the AttributeSplitter, with the ; as a separator character, to break it up into a list.


This was a nice puzzle. Attached a sample workspace what does what you need.


A nice puzzle indeed! I took another approach, mostly consisting of moving data in and out of lists.

Station_list


I'd split the station name and time off first with some regex (assuming the Variable always starts with Var) and then split the remainder, first into groups of the 3 values and then by the semi colon

image


I'd split the station name and time off first with some regex (assuming the Variable always starts with Var) and then split the remainder, first into groups of the 3 values and then by the semi colon

image

Very compact, with much happening in every transformer. Great use of regex too!

Only I didn't like the assumption that the variable name always starts with Var, so I opted for a regex finding the third semicolon. I used a similar regex in the StringSearcher.

Station_list_ebygommCredits should go to @ebygomm​ here though!


Thank you for your answers, it works perfectly. These are some clever uses of regex!


Reply