Copy a txt file in a list

Hello :wave:

I need to put a multiline txt file in a list with one file in one item.
But I have problem to do that.

Here is my exercice :

  • creating and reading the file :
    image

  • laoding the txt file, spliting it into a list and display the item number ? of the list => it doesn’t run properly :
    image

Hello Frederic

Help us to help you!

When you say it doesn’t run properly, what exactly is the result?

Why save the text as a file and import it instead of making a List from it directly?

I create a txt file with names on the root of my smartphone.
Then I call it and I want to display it and offer peaple the possiblity du have an access as if it was a list. So I need to transform that txt file into a list.

The file is for example :
name 1
name 2
name 3

OK - what goes wrong?

When you create a file, do you append \n at the end of each line?

the items a on only one rank and not in any rank as there are lines

Another word meaning “rank”?

Do you mean you see this:

Name 1Name 2Name 3

Instead of this:
Name 1
Name 2
Name 3

rank = index

I want as much index ase there are lines in the txt file

yes you’re right

So, it is down to how the Names are entered in TexteASauver - more than one name at a time?

the file has been writen at once with juste one name per line ( with \n )

…via sauver .Click, only one name is added to the file at a time, and each time \n is appended.

Yes but the aim is not when wrinting but when reading and making the list

It absolutely should work as per your Blocks. We need to copy the text file from the device (phone) and take a look inside with a plain text editor (PC). Can you make a sample file available here?

first I try to use append instead of writing then if any probe.

here is an Skieurs.txt (69 Bytes) example file

Skieur : Anne Marie ALBALAT
Skieur : Luz ALEO
Skieur : Riyas ALLAOUI

In your Blocks, you are not prefixing "Skieur : " ?

what do you mean by prefixing "Skieur : "

Skieur : Anne Marie ALBALAT
â–˛
prefix

OK and ?

You beluive that I can split it accordig that prefix ?