Jump to content

Help. read the text file and search word.


xonepc
 Share

Recommended Posts

hi.

Ready to record.txt file

record.txt

----------

no1 -> Unique value

aaaa -> Unique value

no2

bsha

no3

rthf

no4

fh5f

no5

vfgt

no6

bted

no7

fdfg

no8

4dsf

no9

4gd3

.....

--------

$code_no = InputBox("Search for code_no","Enter Code",""," M","150","150","-1","-1")

Question?

return code_no

Link to comment
Share on other sites

What you can do is use FileReadLine and store your data pair into a couple variables. When the second value is the same string as the input, you return the first value.

But if you're not using a whole lot of data pairs, you're better off just using an .ini file for this. Use any section name you want, then use the input code as your key and the return code as your key value.

Edited by omikron48
Link to comment
Share on other sites

oh.. i see..

change record.txt

record.txt

code_no=code_value

---------------

no1=aaaa

no2=fw4t

no3=445f

no4=5g46

.............

input code_value -> get code_no

i want a code_no..

ps) data sizes are small..

Edited by xonepc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...