Count total rows when opening a txt file (File1)

I need to count the total lines in a text file.

I got the entire file at once using file GotText.

Is there a way to retrieve the tolal rows in a txt file?

Tks

Search for and count \n in the text (+1)
or
Split text at \n then return length of list (+1)

There will be more....no doubt a regex will do this too

Try this extension: LabelPlus:

2 Likes

Hi, Anke. Seems like what I need.

Where can I download LabelPLus ? Tried to find on internet but I found only tutorials but didn''t find the extension

Here is it again:

Hi!

Sorry now I found a link to download com.extension.LabelPlus.aix on the page...

I have added it to my project, but got this error that appears when I import it into my project..

Disconnect the companion and reconnect then start to test

Delete the assets folder from the Companion app on your test device and reconnect to Companion.

You can do this manually or using this app:

Thabk you very much for your help, but I did all you said and didn't work.

Deleted all asset folders of companion APP on my phone(which is connected by USB cable).. reloaded browser.. and same error...

Try this one: LabelLines.aia (36.1 KB)

Same error.. I may try to reinstall the AIstarter maybe?

Connect with Companion and / or build the APK and try.

I haven't had any problems with the USB connection either.

Ok. I will try.. but could you try to exaplain me why this blocks are returning me the result:2?

The file have about 39 lines...

WHat I'm doing wrong?
image

Because you make a list of text and \n.

You need to join text and \n to get a line return

... and...?

Hi.. For some reason, same error.. Maybe I need to reinstall the AiStarter?

With the APK? I do not think so.

Hi! Building the apk it works fine! Weird.. but it does work.. Tks!

Fine, so close the topic by clicking Solution (regardless of whether Companion works for you or not).