المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : كيف يمكن جلب سطر عند البحث عن كلمة


Mahmoud Nabil
22-06-2024, 04:53 PM
الكود دا بيبحث في ملف Gre.txt عن النص Lincs ولو موجود بيطلع رسالة انو موجود ولو مش موجود بيطلع رسالة انه لم يتم العثور عليه
ازاي نطور الكود ونعدل علي الكود بحيث عند ايجاد النص Lincs يتم استدعاء رقم السطر الي اتوجد فيه مع امكانية لاستدعاء السطر كامل

This code searches the Gre.txt file for the text Lincs, and if it exists, it displays a message that it exists, and if it does not exist, it displays a message that it was not found.
How do we develop the code and modify the code so that when the text is found in Lincs, the line number in which it is found is called, with the possibility of recalling the entire line?

x = TextFile.ReadToString("AutoPlay\\Docs\\Gre.txt");
x2 = "Lincs"

if (String.Find(x, x2 , 1, false) ~= -1) then
Dialog.Message("Notice", "It was found", MB_OK);
else
Dialog.Message("Notice", "Not found", MB_OK);
end

مارجوم،
29-06-2024, 11:07 AM
This code searches the Gre.txt file for the text Lincs, and if it exists, it displays a message that it exists, and if it does not exist, it displays a message that it was not found.
How do we develop the code and modify the code so that when the text is found in Lincs, the line number in which it is found is called, with the possibility of recalling the entire line?




test this
https://mega.nz/file/GlsTVQoL#RzbbYLsCVHoi6olIZrHn8HTToQPVyugYqzn32GYM-Sg

Mahmoud Nabil
03-07-2024, 12:14 PM
test this
https://mega.nz/file/GlsTVQoL#RzbbYLsCVHoi6olIZrHn8HTToQPVyugYqzn32GYM-Sg

This project is wonderful, but can the project be developed?
Instead of searching in the Gre.txt file, search in the DOS folder
When the text is found in Lincs, the line number in which it is found is called, with the possibility of recalling the entire line, and the name of the document is also called.

مارجوم،
15-07-2024, 12:52 AM
This project is wonderful, but can the project be developed?
Instead of searching in the Gre.txt file, search in the DOS folder
When the text is found in Lincs, the line number in which it is found is called, with the possibility of recalling the entire line, and the name of the document is also called.



https://www.youtube.com/watch?v=myEP2pp0hqc


https://mega.nz/file/CxUhgQZA#bZ88c1bODbMDUdNsT7DoP7vJfB3owZ0lHJt4aAw2j-Q

Mahmoud Nabil
15-07-2024, 11:16 AM
https://www.youtube.com/watch?v=myEP2pp0hqc


https://mega.nz/file/CxUhgQZA#bZ88c1bODbMDUdNsT7DoP7vJfB3owZ0lHJt4aAw2j-Q

This work is more than wonderful
But I needed to search a path in a full folder and not a file, which means let's say we are going to search for the text "gamal" inside a folder There are more than 20 txt files inside this folder
How can I choose the folder and then automatically search within the files that carry the txt format within this folder for the text "gamal"
When you find the text "gamal" in any txt file inside the folder, the txt file name and line number are called, with the ability to call the entire line
and thank you in advance