#123949 - 2004-07-27 07:41 AM
compare a file in a dir to a string inside a text file.....
|
TTripn
Fresh Scripter
Registered: 2004-07-22
Posts: 8
|
Hi all,
If there is already a script that does this then please provide the link. If not, please provide info on how I can achieve this...
thankyou...
|
|
Top
|
|
|
|
#123952 - 2004-07-28 01:06 AM
Re: compare a file in a dir to a string inside a text file.....
|
TTripn
Fresh Scripter
Registered: 2004-07-22
Posts: 8
|
the file is in a static location...
|
|
Top
|
|
|
|
#123954 - 2004-07-28 10:39 PM
Re: compare a file in a dir to a string inside a text file.....
|
acmp
Getting the hang of it
Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
|
Or do you want to check the contents of a file agaist the text string?
I think this needs a bit of clarification.
If the others have got it right just ignore me, my wife does so you can too.
If however they haven't got it right can you post some more info and an example of what you are trying to achieve.
Thanks acmp<><
_________________________
Every day is a school day
|
|
Top
|
|
|
|
#123955 - 2004-07-29 02:12 AM
Re: compare a file in a dir to a string inside a text file.....
|
TTripn
Fresh Scripter
Registered: 2004-07-22
Posts: 8
|
Hi all,
This is what i want to do:
I have two txt files. Each file contains the @wksta. I want to compare the contents of both files. If the @wksta exist in only file 'A' then output the @wksta into another txt file. If exist in both 'A' and 'B' then execute xxx....
is this enough info?
thanxxxx
|
|
Top
|
|
|
|
#123957 - 2004-07-29 04:11 AM
Re: compare a file in a dir to a string inside a text file.....
|
TTripn
Fresh Scripter
Registered: 2004-07-22
Posts: 8
|
Hi Les,
Unfortunately your code only works if it is executed during the logon process. I'm actually looking for a script that can run independent of the logon process.
thankxx for the help....
|
|
Top
|
|
|
|
#123962 - 2004-07-30 12:54 AM
Re: compare a file in a dir to a string inside a text file.....
|
TTripn
Fresh Scripter
Registered: 2004-07-22
Posts: 8
|
Hi all,
Thankyou for all your help....appreciate it. I managed to spring together these few lines of code and it seems to work for me..
break on $txt1 = @LDRIVE + "\xxx.txt" $txt2 = @LDRIVE + "\yyy.txt" Open (1,$txt1) $rl = ReadLine(1) while @error=0 shell '%comspec% /c find /i "$rl" $txt2' if @error=1 open(2,"%temp%\zzz.log",5) $ = writeline(2,"$rl"+@crlf) endif $rl = readline(1) loop close(2) close(1)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 962 anonymous users online.
|
|
|