Skip to main content

Hi, Is there a transformer within FME that could format CSV into plain text with formatting, see the attachment? The original file can also be in another format, for example excel. If someone can think of another writer that will facilitate the solution of the problem, it can be.

file original - source data

file required - required data

 Thank you

It looks like a pretty complicated format.

 

You have to determine what the column width is to prepent the data with enough spaces, but also have to account for the character-width of your value to determine if you should write data though other column space.

 

Or are the first 10 lines a header that is pretty much fixed?

 

Then you could use https://www.safe.com/transformers/string-padder/ to fix all the column widths and the https://www.safe.com/transformers/string-concatenator/ to glue all the data together.

 

 


It looks like a pretty complicated format.

 

You have to determine what the column width is to prepent the data with enough spaces, but also have to account for the character-width of your value to determine if you should write data though other column space.

 

Or are the first 10 lines a header that is pretty much fixed?

 

Then you could use https://www.safe.com/transformers/string-padder/ to fix all the column widths and the https://www.safe.com/transformers/string-concatenator/ to glue all the data together.

 

 

Hi. Thanks for the reply. I took another look at the source file and couldn't find any logic for individual columns to count characters. I am also attaching the points for viewing. I have to meet with the person who supplied me with the original data and ask. I was looking at setting up the stringPadder transformer, do you think it can be formatted with this? I think the setting is insufficient. Thank you


You would need to know the widths of each column to pad them to the right length before writing out

image


You would need to know the widths of each column to pad them to the right length before writing out

image

Hi Ebygomm. Thank you for the response, on Monday I will try to meet with the person who gives me the data and I will let you know according to which logic the output should be defined. This is a civil aviation system. Thank you very much


You would need to know the widths of each column to pad them to the right length before writing out

image

Hi. I found more detailed information. I need to have the above values written in the txt file. The main criterion is this separator "|" and column width doesn't matter. It should look like the highlighted part in the attachment. Ideally without the header Name, Airspace etc. Please how do I modify it to the required data with the separator "|" and achieve writing to a txt file? Thanks a lot


Hi. I got the solution. If anyone in the future is dealing with the same problem, I am posting the solution below.

Thank you all for your support


Reply