I'm building a process in which a user upload a txt file, and then I need to process it, and for each line save some important values.
My file looks like this:
.
.
.
123123:Pending
343242:Waiting
342324:On Air
.
.
.
I need to proces line by line and save the values on left and right of the ':'
How can I read a file line by line in a task of my process?
Thanks and regards.
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/c9cc37a9-88b9-4c2d-af3f-db4b79f5e4b7%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
Thank you for the reply, your solution worked. However, now I have another problem.
I need to process the array with (["123123:Pending","343242:Waiting","342324:On Air"])
in order to update a collection, but I'm having problems building the record to insert.
Could you help me please?
Thanks again and regards.
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
In addition to my previous post, my purpose is
1- read the file
2- obtain the values
3- check if there is an object in my collection with the data I just read (for every line)
3.a YES ---> update_object
3.b NO ---> save_object
I have the following (cont_file contains the array with my info. Following the example it would be like ["123123:Pending","343242:Waiting","342324:On Air"], but each coordinate of the array I'm using has more fields):
<#list cont_file as line>
<#assign data = line?split(":")>
<#assign record>
{"numSeguimiento":"${data[0]}","numTarjeta":"${data[1]}","fechaultcambio":"${data[2]}","estado":"${data[3]}"}
</#assign>
<#assign searchCollection>
${load_object( {"numTarjeta": "${data[1]}"}, "tarjetas")}
</#assign>
<#if searchCollection == {}>
${save_object(record,"tarjetas")}
<#else>
${update_field( {"numTarjeta":"${data[1]}"}, {"fechaultcambio":"${data[2]}","estado":"${data[3]}"}, "tarjetas", "true")}
</#if>
</#list>
My problem is how to check if load_object obtains a record of my collection or not.
Any idea?
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/9b46ddea-4441-4b76-a69d-48448cc3e981%40runmyprocess.com.