View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Tue Feb 15, 2022 2:00 pm Post subject: Search records for spefic texts |
|
|
I know that Excel has the ability to search cells for "strings" containing certain text.
What I'd like to do is to search all the records in a table for the text swim, it will be a partial and may be anywhere in a description. This is an old table and has over 2k records. Any thoughts?
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Feb 15, 2022 2:48 pm Post subject: |
|
|
If, by table, you are referring to a cheat table, then you can use notepad++.
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Tue Feb 15, 2022 4:51 pm Post subject: |
|
|
Well, yes, but that wouldn't allow any value manipulations.
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Feb 15, 2022 5:27 pm Post subject: |
|
|
Perhaps it would be more helpful if you can explain more regarding what you are trying to accomplish.
Regarding Notepad++, you can search and replace all text, but I can still only guess if that would be beneficial for you.
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Tue Feb 15, 2022 7:17 pm Post subject: |
|
|
++METHOS wrote: | Perhaps it would be more helpful if you can explain more regarding what you are trying to accomplish.
Regarding Notepad++, you can search and replace all text, but I can still only guess if that would be beneficial for you. |
Find those records that have swim and modify the values.
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Feb 15, 2022 8:01 pm Post subject: |
|
|
Still not clear. I am sorry.
|
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 958
|
Posted: Tue Feb 15, 2022 8:31 pm Post subject: |
|
|
To enumerate the memory records,
Code: |
local al = getAddressList()
for i=1,al.Count do
local mr = al[i-1]
-- check mr eg. is mr.Description has 'swim'?
if mr.Description:lower():find'swim' then -- lower() for case insensitive
-- do thing on it
end
end
|
_________________
- Retarded. |
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Wed Feb 16, 2022 8:00 am Post subject: |
|
|
panraven wrote: | To enumerate the memory records,
Code: |
local al = getAddressList()
for i=1,al.Count do
local mr = al[i-1]
-- check mr eg. is mr.Description has 'swim'?
if mr.Description:lower():find'swim' then -- lower() for case insensitive
-- do thing on it
end
end
|
|
The find was new to me and the first three lines are what I had, but for some reason I'm getting an error on step three:attempt to call a userdata value(global al) Script error
|
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 958
|
Posted: Wed Feb 16, 2022 8:38 am Post subject: |
|
|
Would you mind share the code so far?
_________________
- Retarded. |
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Wed Feb 16, 2022 10:18 am Post subject: |
|
|
Code: | al = getAddressList()
for i = 1, al.count do
mr = al(i)
if mr.Description:find"Swim" then
print(mr)
end
end
|
I looked in the table an the partial was Swim full Swimming
Last edited by bknight2602 on Wed Feb 16, 2022 1:39 pm; edited 1 time in total |
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Wed Feb 16, 2022 11:50 am Post subject: |
|
|
You're using parentheses which makes it a function call. You need to be using the square brackets. i.e. change "al(i)" to "al[i]".
_________________
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Wed Feb 16, 2022 1:42 pm Post subject: |
|
|
TheyCallMeTim13 wrote: | You're using parentheses which makes it a function call. You need to be using the square brackets. i.e. change "al(i)" to "al[i]". |
Code: | al = getAddressList()
for i = 1, al.count do
mr = al[i-1]
if mr.Description:find"Swim" then
print(mr.Description)
end
end |
Works, thanks to all.
|
|
Back to top |
|
 |
|