Go Back   RunUO - Ultima Online Emulation > RunUO > FAQ Forum

FAQ Forum A place to find answers to the most frequently asked questions, and a place to post said answers. Do NOT use this forum to ask questions.

Reply
 
Thread Tools Display Modes
Old 02-04-2010, 07:19 PM   #1 (permalink)
Newbie
 
Join Date: Jan 2010
Posts: 29
Default A Better / More Robust method of searching *.cs file contents

Windows *Find in Files* is ... spotty (at best) ... when it comes to searching for specific text references in *.cs files.

A better, more robust way of searching can be found by installing Cygwin, which is a Linux-like environment for Windows. You can download it for free from Cygwin Information and Installation

Once installed, open cygwin and cd to your directory. If you are not familiar with Linux this may be intimidating, but it really will find what you are looking for.

For an example, on my flash drive I type the following at the command prompt:
Code:
 cd G: <Enter>
The window will then display:
Code:
my_login@my_computer_name /cygwin/g
I then change directory to the location of my RunUO installation.
Code:
cd RunUO\ RC2
You can either escape the space in the file name with a backslash '\', or by putting the entire filename in double quotes.
Code:
cd "RunUO RC2"
Now that you are in the directory you want to begin your search, enter in the entire line of text, all on 1 line:
Code:
find ./ -exec grep -l "the text you are searching for" {} \;
In essence you are searching from the current folder, the contents of every file (even in sub-folders) for the exact string of text you are looking for. As a side note, you can perform a case insensitive search by adding a -i alongside the -l (lower case L) to the grep command. (Or, to provide an example)

Code:
find ./ -exec grep -i -l "the text you are searching for" {} \;
NOTE: the text must be entered exactly! Linux/UNIX is case sensitive. -i is not the same as -I.

Last edited by Azzerhoden; 02-04-2010 at 07:22 PM.
Azzerhoden is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5