Jump to content
Sign in to follow this  
TheBobynator

search in a file

Recommended Posts

TheBobynator

hi,

I want to search a word in a file and then I want to get the line from the seached word.

Example:

I search the word "hello" in the file "test.txt" and then I get the line from the search word.

can someone help me, pls. THX

Share this post


Link to post
Share on other sites
FireFox

@TheBobyNator

Use _FileReadToArray

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
TheBobynator

can you write an example because the example from the helpfile I dont understand

Share this post


Link to post
Share on other sites
youknowwho4eva

write up a script using the example. If it doesn't work post your code and we'll help you fix it.

Edit: typo

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites
TheBobynator

can you please help me, I dont know to make these

Look:

___________________________test.txt

cat

dog

mouse <====This is the file test.txt

horse

tiger

________________________________

....

.....

select

case $button

$getline = read the file test.txt and get the line which the word horse is writing

guictrlsetdata($input,$getline)

endselect

.....

....

can you give me please a simple example

Edited by TheBobynator

Share this post


Link to post
Share on other sites
FireFox

@TheBobyNator

We wont help you until you would take a look to help file !

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
TheBobynator

I looked on the helpfile but I dont understand it

Share this post


Link to post
Share on other sites
FireFox

@TheBobyNator

Without the helpfile I would writte _FileReadToArray("yourfile.ext","mouse") ... no ?

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
youknowwho4eva

well firefox suggested filereadtoarray and I don't see that in your little sample.


Giggity

Share this post


Link to post
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
Sign in to follow this  

×