- Posts: 27
From Excel to Flat Txt File - rows to columns
- Gennaro
- Topic Author
- Offline
- User
Less
More
11 years 7 months ago #2277
by Gennaro
From Excel to Flat Txt File - rows to columns was created by Gennaro
hello,
i have an inoput file like this:
and i need to produce a txt output like this:
basically, on the output i have to put on the same row, the records from 1 to 4 of the input file, then, continue with the second row with the records 5 to 8, and so on.
is something that i can manage with flowheater?
thanks for your help
regards
i have an inoput file like this:
and i need to produce a txt output like this:
basically, on the output i have to put on the same row, the records from 1 to 4 of the input file, then, continue with the second row with the records 5 to 8, and so on.
is something that i can manage with flowheater?
thanks for your help
regards
Attachment example_output.txt not found
Attachments:
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
11 years 7 months ago #2278
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 Re:From Excel to Flat Txt File - rows to columns
Hi Gennaro,
It's possible but a bit tricky
You need the GroupBy Heater to grouping the CSV or Excel records. The problem is that usually the GroupBy Heater group’s data related to the content.
In your case you need the .NET Script Heater and a short C# Script to simulate the group value. Please have a look to the example I’ve attached. In the Script there is a remark were you can change how many rows are grouped together.
With this we can group always four CSV or Excel rows on the READ site to one record on the WRITE.
Now we just have to decide which row/content we have to move to the WRITE side. You need for each field one IF-THEN-ELSE condition together with one AutoID Heater to decide which grouped row you want to put to the WRITE.
NOTE: The IF-THEN-ELSE condition =1 means that the row content from the first are moved to the field, =2 ….
It's possible but a bit tricky
You need the GroupBy Heater to grouping the CSV or Excel records. The problem is that usually the GroupBy Heater group’s data related to the content.
In your case you need the .NET Script Heater and a short C# Script to simulate the group value. Please have a look to the example I’ve attached. In the Script there is a remark were you can change how many rows are grouped together.
With this we can group always four CSV or Excel rows on the READ site to one record on the WRITE.
Now we just have to decide which row/content we have to move to the WRITE side. You need for each field one IF-THEN-ELSE condition together with one AutoID Heater to decide which grouped row you want to put to the WRITE.
NOTE: The IF-THEN-ELSE condition =1 means that the row content from the first are moved to the field, =2 ….
Attachment grouping_csv_records.zip not found
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.263 seconds