Dynamic data import / export

datenbank

simply more productive
Up to 10,000 records can be processed with the freeware version!
Welcome, Guest
Username: Password: Remember me
Welcome to the FlowHeater support forum.

Questions about using FlowHeater are answered here.

TOPIC: Export Data where the new column headers are in rows

Export Data where the new column headers are in rows 5 years 5 months ago #2133

  • George
  • George's Avatar
  • Offline
  • New Member
  • Posts: 1
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:
The administrator has disabled public write access.

Re:Export Data where the new column headers are in rows 5 years 5 months ago #2134

  • FlowHeater-Team
  • FlowHeater-Team's Avatar
  • Offline
  • Administrator
  • Posts: 240
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.
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: This email address is being protected from spambots. You need JavaScript enabled to view it.
First part: Email Address
Second part: This email address is being protected from spambots. You need JavaScript enabled to view it.

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
Attachments:
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.
The administrator has disabled public write access.
Moderators: FlowHeater-Team
Time to create page: 0.078 seconds