(Help me) I want to get the value which line it is in

New Year is coming. Good day!!!

I want to obtain the value which line it is in.
The left side is the txt file formatted as csv format.

For example,
When I input “M004” on the Textbox1, I want to get “5” on the label6,
When “F005” on the Textbox1, “10” on the label6.

Try something like this:

This looks like a handy thing to have in a procedure:
pairs_library.aia (3.8 KB)

1 Like

Thank you, Abraham.
That procedure looks very useful.
But I can’t fully understand as I am a beginner.
Could you explain once again more easily how to apply to my case?
I attach the failure message.

use Do it to debug your blocks
see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
in your case your list is not a list...

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

Try this:

My procedure does not eat file names, only tables.
You can't skip steps like reading the file and
catching the incoming file .GotText and unpacking the csv table.

Thank you for your solution.

I tried your way and it does work well as far as the txt file has the value of the TextBox1.Text.
But when the txt file has not the matched the TextBox1.Text, it doesn’t work and no result.
(for example when input “M006”, there isn’t “M006” in the txt file)
So I inserted the “else” or “elseif”, the result was same.
I want to fix this error and show an error message like “Not found”.
I attach an aia file, a png file and a txt file here.

I wish all have happy new year.
by_Anke.aia (2.9 KB) report.txt (161 Bytes)

I didn’t know that.
Thank for the good information.
In future I should try to use this function.

It has been fixed like this.

I appreciate all power users offered me solutions and infomations.

1 Like

... or this:

You might want to "like" an answer and especially click "Solution" if your question has been answered.

Thank you Abraham for this sophisticated solution.
But this may be a little hard to digest for beginners. :wink:

by_Anke_ABG.aia (4.3 KB)

I am only now digesting some things I was supposed
to have learned decades ago.
(Much to the detriment of my Grade Point Average).
I am grateful that I had the head start, though.

1 Like