- Posts: 1
Entries with no dates
- Richard Jupp
- Topic Author
- Offline
- User
Less
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
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.
- FlowHeater-Team
- Offline
- Admin
10 years 11 months ago #2301
by FlowHeater-Team
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.
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.
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.
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.
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 or Create an account to join the conversation.
Time to create page: 0.266 seconds