Elements do not see in the list, only the first




46512Dicembre2020.txt (229 Bytes)

Gabriele, this is an international forum, please use english language in your blocks.

We probably need to see the text file itself Gabriele.

You can populate a Listview with a list or a string with comma separated elements, then you have to add all elements to a list in your FOR cycle.
If you can not please attach your aia file

You first created a list from a CSV file. Then you converted this list to a text string by removing the parentheses and quotes. You then split the string into a list using commas. You have created a long list and you only fetch items 2, 3, and 4. You don't need to remove the parentheses and quotes. Insert your AIA.

thanks for the reply, I'll post the project, thanks again

Cartellini.aia (11.5 KB)

I corrected

Cartellini (1).aia (10.8 KB)

thanks for the reply, I'll post the project, thanks again

I had the need to use kio4 instead of the file component and I find myself with the same problem, I only see the first element with the first field of the second

Gabriele, posta blocchi in inglese, altrimenti nessuno li capisce

opsssss, sorry so much

1 Like

If you added a component and it stopped working, look for the reason in the component. See what you get at the component output from KIO4. You must receive the data as in the file, i.e. lines separated by a new line and columns with commas.

Hello Gabriele,
(i'm Italian too, but I write in English so everyone can enter this conversation).
It is not clear to me what you are doing.
Let me try to say what i have understood: you read a csv file, in which the data are comma separated.
What you create is a list of all the data (bollature :slight_smile: giornaliere) of daily timestamps when you get in and get out of the office/plant.
You put all together into a list variable (global_elenco_timbrature) then you want to create one record for each day and put these records in a list called "lista".
To do this you point to the first row in global_elenco_timbrature, you select the elements from 2 to 7 in order to create the record fro one day. Am I correct ?
But when you go to the next row in the elenco_timbrature list, the elements (of the second row) shouldn't be from 9 to 14, and so on ?
Your variable "elemento" is an item of elenco_timbrature, then the number of items in that list is = to all the data of the csv file. So when you skip to the next row the elements do increase by 7 (or the numer of items for one day).
As I said, maybe I did not understant your algorithm, but it seems to me that you are missing this increment.
What are your thought on this ? Would this help you ?
Ciao, Ugo.

I think you didn't understand this algorithm ;). When he read the file with the built-in "File" component the algorithm was working. After adding the component from kio4 it stopped working. I think this component modifies the text somehow. It needs to see what it gets at the component output, maybe it's not a valid csv anymore.

Ok Patryck,
but the elements that he uses are always the elements from 2 to 7 which are read from the global_elenco_timbrature list variable. If he does not increment the elements by 7 (or whatever is the modulo) he always uses the same first 7 elements (I guess :thinking:).
Honestly I did not try the algorithm, I just thought on it :grin:
Let's wait for his answer.... :hugs:

Look above the posts and read what he wrote earlier. The algorithm was working. You have to know what is at the output of the new component because you can't guess.

1 Like

Dear Gabriele,
I have rewritten the algorithm because I saw that you were using the variable elemento instead of the variable elenco_timbrature (the block select list item list needs a list name).
Please take a look here below. This is a simplified version : I create manually a list and from that list I create a secondary list putting together 2 elements (the value of modulo) each time.
I run it on my phone and it works: from a 12 elements primary list I get a secondary list of 6 elements each one composed by two elements of the primary. (it's longer to say than to see it working :grin:)

BUT => take care of what Patryk is saying: you must be sure of what KIO4 is giving you back when you split the file and create the elenco timbrature list.

1 Like

Thank you very much for the answers, as soon as I have a moment of time I try and study it anyway, to be clear:
each line is an "E" entry "U" exit stamp, date, hour and minute and I would like these to be in columns.
with the "file" method it was ok, but I need to create the files and then use KIO.
Patryk_f he understood perfectly well

Thanks a lot to everyone

here's what kio4 comes out with this file24615Dicembre2020.txt (50 Bytes)

So instead of a list of lists, you have one long list. I don't know what this extension is and what it is for, but something is wrong here. Apply @uskiara algorithm in this case.