Skip to main content
simply more productive

The Data Specialist

Thanks to our intuitive transformation designer, you can convert data effortlessly to a variety of formats without knowing how to program. It’s not only efficient, it’s also easy to use.
Flowheater Download

Export Data where the new column headers are in rows

More
12 years 8 months ago #2133 by George
Hi Guys
I need some help please.
I am trying to import the attached file and export it to a TXT format so I can then import it into my ACT! database.

The problem I have is:
1. The columns headers (for the output file) are in rows separated by colons, and the value of the data is in the same row.

2. The email addresses at the beginning of each enquiry; i need flowheater to pass it and not import it.

If someone could please assist that would be great

George

Attachment test.txt not found

Attachments:

Please Log in to join the conversation.

More
12 years 8 months ago #2134 by FlowHeater-Team
Replied by FlowHeater-Team on topic Re:Export Data where the new column headers are in rows
Hi George,

This challenge is possible but a bit tricky :)

First you need one GroupBy Heater for group all email rows to one row. To determinate each email we need an additional .NET Script Heater and the following little script.
Code:
int nGroupCount = 0; public object DoWork() { if (InValues.Length != 1) throw new Exception("1 Inputparameter expected"); // get the first input parameter string sIN = (string)InValues[0].GetString(); if (sIN == null) return nGroupCount; if (sIN.IndexOf("From:", StringComparison.CurrentCultureIgnoreCase) >= 0) { // if we found the string "From: " in the line we have a new group nGroupCount++; } return nGroupCount; }

The Script checks each line. If the line contains the string "From:" then we have a new group or a new email.

Second we need to fill the columns with the certain field parts. For this you have to use for each column you want to export the IF-THEN-ELSE Heater and the String Split Heater .

The Split Heater splits only each line into 2 Parts using the delimiter ": "

e.g. Email Address: hottie@hot.com
First part: Email Address
Second part: hottie@hot.com

In the IF-THEN-ELSE Heater you have to specified for each column a condition like this
** Email Address

Note: ** is the InString operator!

If the condition match the Value goes out from the IF-THEN-ELSE Heater to the column "Email Address".
To demonstrate this I have made an example; please have a look to the attachment.

Attachment rows_to_columns.zip not found



Hope this helps

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Attachments:

Please Log in to join the conversation.

Time to create page: 0.291 seconds

FlowHeater - The Data Specialist

Efficient data integration and transformation with FlowHeater – the perfect solution for a seamless transfer of your data.

Rechtliches

Support & Contact

Kontaktinformation

Telefon:0951 / 99339792 E-Mail:This email address is being protected from spambots. You need JavaScript enabled to view it.

Copyright © 2009-2024 by FlowHeater GmbH. All rights reserved.