Skip to main content
Question

How to transform email json to other file

  • May 24, 2016
  • 6 replies
  • 20 views

Forum|alt.badge.img

Good day!

I have an issue with reading email messages. We plan to utilize an information about vessels (some information and current location). Contractor provides this information in email message. Looks like simple message in email:

As a result of process this email content in WB i have next table:

But i don not need data in excel table (it's only for test). Result should be a shape file and all attributes should be stored in separate columns where (for example) vessel_name is column name and Vinsky Star is value...that is for all records.

How i can do it?

Thanks before hand)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

david_r
Celebrity
  • May 24, 2016

Hi

You can use the AttributeSplitter to first split individual lines, then splitting on ": " to get the key/value pairs.

David


takashi
Celebrity
  • May 25, 2016

Hi

You can use the AttributeSplitter to first split individual lines, then splitting on ": " to get the key/value pairs.

David

I agree that the AttributeSplitter is a quick way to split each line into key and value, if every separator colon is always followed by a space. However, I found an exception in the data. In this line, there wasn't a space between the colon and following string.

Mailto:vessel.tdp@de.com 

If it's not a typo, the StringSearcher with this regex might be better.

^([^:]+)\s*:\s*(.*)$ 

david_r
Celebrity
  • May 25, 2016

I agree that the AttributeSplitter is a quick way to split each line into key and value, if every separator colon is always followed by a space. However, I found an exception in the data. In this line, there wasn't a space between the colon and following string.

Mailto:vessel.tdp@de.com 

If it's not a typo, the StringSearcher with this regex might be better.

^([^:]+)\s*:\s*(.*)$ 

Or just split on ":" and then use an AttributeTrimmer :-)


takashi
Celebrity
  • May 25, 2016

I agree that the AttributeSplitter is a quick way to split each line into key and value, if every separator colon is always followed by a space. However, I found an exception in the data. In this line, there wasn't a space between the colon and following string.

Mailto:vessel.tdp@de.com 

If it's not a typo, the StringSearcher with this regex might be better.

^([^:]+)\s*:\s*(.*)$ 

I also thought so, but...

Position date & time: 2016-05-20 04:01:33

:-0


david_r
Celebrity
  • May 25, 2016

I also thought so, but...

Position date & time: 2016-05-20 04:01:33

:-0

Whoops. Regex it is, then...


Forum|alt.badge.img
  • Author
  • May 26, 2016

@david_r, @takashi

Gents, many thanks!)