Author: Christophe Theron
Date: 22:49:09 05/25/02
Go up one level in this thread
On May 25, 2002 at 17:04:10, Jeremiah Penery wrote:
>On May 25, 2002 at 15:29:31, Christophe Theron wrote:
>
>>On May 24, 2002 at 18:17:52, Jeremiah Penery wrote:
>>
>>>On May 24, 2002 at 14:39:19, Christophe Theron wrote:
>>>
>>>>On PC, I have solved this since a long time by writting my own variation of
>>>>grep. But there are anyway thousands out there that you can get for free.
>>>
>>>The DOS shell has a "find" command, which works a lot like grep.
>>
>>
>>
>>Yes but FIND assumes that the files you are searching in are text files.
>>
>>I wanted to be able to find the string "version" in binary files for example.
>
>Umm, "find" does this. Here is some output (I snipped a lot):
>
>C:\chess>find "crafty" *.*
>Access denied - 18.15
>
>---------- 18.15.EXE
>crafty is behind %4.1f on time, reducing by 1/%d.
>time remaining: %s (crafty).
>usage: rating <crafty> <opponent>
>use 'settc' command if a game is restarted after crafty
>usage <percentage>........adjusts crafty's time usage up or down.
>the "crafty format" requires three lines per position.
>time. If crafty likes the solution move for [N]
>name of the file in crafty test format. [N] is an
>test is used to run a suite of "crafty format"
>crafty.rc/.craftyrc file since they will be constant for a
>commands can be added to the .craftyrc file.
>used internally to control how crafty uses the opening book.
>safety scoring terms, and might tend to make crafty try
>crafty found, before a comment is generated (pawn=1.0). time is
>entered, crafty will make that move, switch sides, and
>%s/crafty.rc
>Access denied - 1810SE
>
>---------- CONTROLSE.EXE
>%s/crafty.rc
>time remaining: %s (crafty).
>usage: rating <crafty> <opponent>
>use 'settc' command if a game is restarted after crafty
>crafty is behind %4.1f on time, reducing by 1/%d.
>
>---------- CRAFTY-18.10SE.TAR
>* other, no comment is produced, otherwise crafty inserts the evaluation for *
><many more lines here>
>| back and forth. when crafty reaches the point where it |
> Print(128,"crafty is behind %4.1f on time, reducing by 1/%d.\n",
> int val=(crafty_is_white)?last_search_value:-last_search_value;
> LearnBook(tree,crafty_is_white,val,0,0,1);
>Access denied - CRAFTY-18.12
>
>---------- CRAFTY-18.12.ZIP
>crafty.cUT
>crafty.cUT¢À
>Access denied - CRAFTY-18.13
>
>---------- FAQ.HTML
>Win32 (wcrafty.exe), not the version compiled for MS-DOS (crafty.exe).
>"subscribe crafty-list" in the body.
> xboard -fcp "./crafty" -fd <I>crafty_directory</I>
>Here <I>crafty_directory</I> is the directory where you installed Crafty.
>You must use the version of Crafty compiled for Win32 (wcrafty*.exe),
>not the version compiled for MS-DOS (crafty*.exe), and it is best to
>
>---------- WINBOARD.HLP
>v15/crafty.doc
>v15/crafty.faq
>v15/wcrafty-15.*.exe
>. Then type the following command line. Use the actual name of the wcrafty file
>you downloaded, not an
> the closing quotation mark. Use the actual name of the wcrafty file you downloa
>ded, not an
>
>---------- ZIPPY.README
> -fd /home/crafty -fcp crafty -icshelper timestamp \
> -fd /home/crafty -fcp crafty -icshelper timeseal \
>
>C:\chess>
>
>All those "access denied" messages are for directories, not files.
>
>>So I wrote an utility that makes no assumption on the type of the files to
>>search and can be used to do various things neither find nor grep can do.
>
>For example?
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ EF Version 1.00 Copyright (c) 1995 Christophe Th‚ron ³
³ Recherche de chaŒne de caractŠres dans tout fichier ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Syntaxe: EF fichier "texte" [/option] [/option] ...
/u : tenir compte des majUscules/minUscules
/e : mot Entier: texte ne doit pas faire partie d'un autre mot
/f : afficher seulement le nom du Fichier
/n : afficher le nom du fichier et le Nombre d'occurences
/s : parcourir aussi tous les Sous-r‚pertoires
/m : afficher une Marque devant le texte trouv‚
/p : afficher la Position du texte dans le fichier
/l : afficher le nø de la Ligne (pour les fichiers textes)
/t : afficher le Texte, sans le nom du fichier
/c : afficher la ligne ComplŠte (jusqu'… 255 caractŠres)
/a : afficher le nom des fichiers dont le texte est Absent
/i : afficher le texte s'il n'apparaŒt dans aucun fichier
/d : afficher ce qu'il y a DerriŠre le texte trouv‚
Dans le texte, le caractŠre '?' sert de joker.
En sortie, ERRORLEVEL=1 si texte trouv‚, ERRORLEVEL=0 si pas trouv‚.
Pendant la recherche, [Espace]=PAUSE [Echap]=ARRET
Exemples: EF *.C printf EF *.exe ver: /u EF *.* "??DOS ?.??" /M /p
I'm sorry, it's in french.
You can switch case sensitivity. You can search for whole words only. You can
get a listing with file names only (which file contains this?), you can get a
listing with number of occurences instead of the occurences themselves, you can
search in the subdirectories, you can get a listing with a big mark before the
occurences (to make them more easy to read), you can get a listing with the
absolute position of the occurences in the files (in characters) or the line
number (for text files only).
You can also print the occurence itself without the file name, get the full
occurence up to 255 characters, get a listing of files NOT containing the text,
print the text only if it appears in NO file, and finally not print the
occurence but only the text that follows immediately the occurence.
Additionally an errorlevel is returned if the text is found (useful for batch
files) and you can use space and escape to pause and stop.
It does not work with regular expressions, it only accept the "?" character as
joker. But it is very fast.
Find is nowhere near.
Christophe
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.