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 Chart

Entries with no dates

  • Richard Jupp
  • Topic Author
  • Offline
  • User
  • User
More
10 years 11 months ago #2300 by Richard Jupp
Entries with no dates was created by Richard Jupp
I have a csv file with a series of entries that are preceded by a time date stamp on separate lines.

So something like this:

Time; Date; Data 1; Data2;
13/11/2013 10:26:35
2520,0 9354,7
9354,7 2520,0

When importing the data I wold like it to appear like this:

Time; Date; Data 1; Data2;
13/11/2013 10:26:35
13/11/2013 10:26:35 2520,0 9354,7
13/11/2013 10:26:35 9354,7 2520,0

Is this achievable with this software?

Thanks in advance for your help.

Regards

Richard

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #2301 by FlowHeater-Team
Replied by FlowHeater-Team on topic Entries with no dates
Hi Richard,

It’s possible but a bit tricky. For this you have to use the .NET Script Heater , the little script below and last but not least the Filter Heater , too filter out the Date/Time CSV rows.

Code:
public object DoWork() { int count = InValues.Length; if (count != 1) throw new Exception("one input parameter expected!"); string sIN = (string)InValues[0].GetString(); if (sIN != null && sIN.Length >= 8) { // Check for date values if (sIN[2] == '/' && sIN[5] == '/') { // Set DATE / TIME parameter for further processing -> GetParameter Heater char [] split = { ' ' }; string [] sDT = sIN.Split(split); // Set parameter DATE Parameter["DATE"].Value = sDT[0]; // Set parameter TIME if (sDT.Length >= 2) Parameter["TIME"].Value = sDT[1]; else Parameter["TIME"].Value = ""; return true; // Filter this row } } return false; // do not filter this row }

Move a .NET Script Heater and a Filter Heater into the Designer . Connect the first CSV column with the input of the .NET Script Heater. The output you have to connect with the Filter Heater. Double click on the .NET Script Heater and insert the script above. That’s all :)

The script decides whether the CSV row is a DATE/TIME row. In case the CSV row contains a DATE/TIME row the script copy the DATE and TIME value into two FlowHeater Parameter with the same name and filter this CSV row out. On the WRITE side you could access to these Parameter values by using the Set/Get Parameter Heater .

You’ll find a little example in the attached file.

File Attachment:

File Name: csv-processing.zip
File Size:2 KB

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.266 seconds
FlowHeater Logo

FlowHeater - The Data Specialist

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

Legal information

Support & Contact

Contact

Phone:
0951 / 9933 9792

eMail:
This email address is being protected from spambots. You need JavaScript enabled to view it.


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