Skip to main content

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)

Hi

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

David


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.

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

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.

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

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


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.

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

I also thought so, but...

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

:-0


I also thought so, but...

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

:-0

Whoops. Regex it is, then...


@david_r, @takashi

Gents, many thanks!)


Reply