Archive of Posts from old forum

Tool for Search and Replace across multiple files.
Post Reply
User avatar
DigitalVolcano

Archive of Posts from old forum

Post by DigitalVolcano »

DigitalVolcano
TextCrawler TextCrawler is a new tool for searching and replacing over many text files. Good for programmers, web designers, or anyone who uses text files.

New Update - V1.0.5 - various upgrades/fixes.

Update! Version 1.0.4 Now out for download. Please update as this version has some important changes.

modified: 30 Aug 2007 19:31 GMT

modified: 31 Aug 2007 18:56 GMT

modified: 24 Sep 2007 17:29 GMT
Edit
01 Jul 2007 16:39
Sylvanie
regexp little bug Hello
thx for this powerfull tool !
I 'm using it often.
I have noticed a little troubleshoting when using regular expr (I have tested it with 2 computers) :
make a replace action with reg exp filter, and replace with ?

Ok, this replace is wrong because I have forgotten the character \ before ?

Nevertheless it involves a crash of the application instead an error message.

Bye 14 Jul 2007 16:17
DV
Bug Thanks for pointing this out. The replace works, but it crashes when showing the file preview window when it's finished - it's a major bug when replacing using certain characters. So carry on as normal but you'll have to restart the program when it crashes. I'll get a fix uploaded very soon! 17 Jul 2007 08:30
DigitalVolcano
DV Crash is fixed in version 1.0.2, available for download here - http://www.digitalvolcano.co.uk/textcrawler.html
Edit
23 Jul 2007 07:18
Derell Licht
feature request I would very much prefer to have *all* hits shown in one window... show filename, list all hits in file, show next filename, show all hits in file, repeat until done.

One of the most common reasons for me to grep a bunch of files for a string, is to find which file actually has the function. It's awkward when I have hits in 20 files, and have to view one file's hits at a time. 23 Jul 2007 23:58
AbteriX
Improvents First let me say thank you for such a wonderful tool!
And here goes my suggestions ;-)


1) let the Registry alone, use an INI for settings , please

2) expand the Favorites to store the REPLACE expression also.
I want to store the search string and the replace string as pair for reuse later.


3) if you don't mind clean the GUI please to make it more pro.



4) maybe search/replace multi lines WITHOUT RegEX
Like:
Find block:
# 1.0-0 - Initial Release
# 1.0-1 - VBScript check. Splash Screen.
# 1.0-2 - Bugfix (Preview crash after replace)

Replace block:
# 1.0 - Initial Release, works great already.
# 1.1 - VBScript check. Splash Screen option.
# 1.2 - Bugfix (Preview crash after replace)



5) maybe increase the "Find" and "Replace" boxes?
F.ex. pop-up an edit box by pressing an hot key.

And/or instead of resize the edit boxes only, perhaps
it would be nice to start the default Windows editor?
The advantage for this would be:
we could increase the font size to see all this (\n|.*?) better
and/or use our default editor for building the regexes.

Thanks
Stefan
Nice forum... postings without register,...fine! 02 Aug 2007 10:41
AbteriX
Version without inst One more:

If possible, distribute an release as ZIP/RAR archive
without an installer and without the VB run times.

This make the download smaller also and
your tool is from more interest for user who care of size. 02 Aug 2007 10:44
AbteriX
Find x AND y NOT z If you like more suggestions...

maybe add boolean option:

Search: myFunc( {+} v1.2 {-} ToDo

Find all file contain:
"myFunc("
AND
"v1.2"
BUT NOT
"ToDo"



I think {+} and {-} are signs no one use other where and RegEx nether do. 02 Aug 2007 19:10
DigitalVolcano
Suggestions Thanks for these suggestions, I'll will be taking them into account for the next version!
Edit
03 Aug 2007 08:53
Grepper
Excel file Search Pr I love this program! Except.....

I am searching for a number (50121439) in a column of an Excel spreadsheet. If the number is placed in a cell that is formatted as TEXT, TextCrawler can find it. If the number was placed in a cell formatted as GENERAL, TextCrawler does not find it.

Unfortunately, I an searching hundreds of spreadsheet s that, when they were created, the entries were usually, but not always placed as GENERAL format.

I have tried various ways of searching but can not figure out how to get this to work for numbers stored in cells formatted as GENERAL.

Please help! 03 Aug 2007 15:12
DigitalVolcano
Excel Hi
Textcrawler is designed for use with plain text files only. File formats such as Excel and Word are in a propriatary binary format by Microsoft, and as such won't work properly. If you do any replacements in these you are likely to corrupt the file, so be warned!
Edit
03 Aug 2007 18:15
Grepper
Excel Darn, I was afraid of that! Thanks for the info and the warning - I am not doing any replacing.

Nice program otherwise! 03 Aug 2007 19:34
B James
Extract/Delete Text? I would like to extract the name/phone fields from my Skype (exported) contact list. The list is exported as .VCF (vcard). A sample record is below..
BEGIN:VCARD
VERSION:3.0
N:+18887576500
X-SKYPE-PSTNNUMBER:+18887576500
X-SKYPE-DISPLAYNAME:BellSouth
REV:01070801T180322Z
END:VCARD

Some records have additional fields if depending on what
skype info was added. I want the 2 fields below to be extracted, and/or the rest of each record trashed.
X-SKYPE-PSTNNUMBER:+18887576500
X-SKYPE-DISPLAYNAME:BellSouth

I am brand new to Textcrawler and did not see how to do this in the readme - can Textcrawler do this? - Thanks 04 Aug 2007 23:15
DV
Extract/Delete You could try-

X-SKYPE-(PSTNNUMBER|DISPLAYNAME).*?)\r

to extract the required lines.

To strip this of the field names save the extracted file, and run a replace on it:

Search:
X-SKYPE-(PSTNNUMBER|DISPLAYNAME).*?)\r
Replace:
$2 06 Aug 2007 17:25
AbteriX
Start Location optio Feature wish
if possible please add 'command line' option
to start TextCrawler whit an defined Start Location:

TextCrawler /D "Start Location"

F.ex. start TextCrawler from an desktop link with default dir:
TextCrawler.lnk
"C:\Tools\TextCrawler\TextCrawler.exe" "C:\Tests"


--

Other command line options are welcome as well,
but from minor interest i think:
/T "htm, html" --- load this Typ of files from working dir
/L "C:\Test\fileslist.txt" --- load from List of files, *1
/F "C:\Work\*.html" --- start and load all html Files in dir X

*1 needed for use with file managers and selected files 07 Aug 2007 11:09
AbteriX
Start Location optio Feature wish
if possible please add 'command line' option
to start TextCrawler whit an defined Start Location:

TextCrawler /D "Start Location"

F.ex. start TextCrawler from an desktop link with default dir:
TextCrawler.lnk
"C:\Tools\TextCrawler\TextCrawler.exe" "C:\Tests"


--

Other command line options are welcome as well,
but from minor interest i think:
/T "htm, html" --- load this Typ of files from working dir
/L "C:\Test\fileslist.txt" --- load from List of files, *1
/F "C:\Work\*.html" --- start and load all html Files in dir X

*1 needed for use with file managers and selected files 07 Aug 2007 11:10
Mac
Checkbox labels Hi,

Amazing program. Just wanted to point out one problem I am facing, its with the checkbox display names. I use a XP theme called Luna Elements 5 and with this the check box labels don't show up. Don't have a issue if I use the XP default theme. Have attached screenshots.
http://img299.imageshack.us/img299/2416 ... ieswm2.jpg
http://img178.imageshack.us/img178/6787 ... er1xe8.jpg
http://img299.imageshack.us/img299/3229 ... er2iv3.jpg

Thanks,

Mac 12 Aug 2007 08:06
Jo�o
Window Hi,

Great program, but every time it starts shows an "about window". How can i get rid of it ?

Thanks 12 Aug 2007 08:47
DigitalVolcano
Suggestions Thanks Abterix / Derrell for your comments - I will be looking into these features for the next version. Things are busy at the moment, but hopefully I'll get time!

Mac - I'll check it out but it sounds like there is a clash between Visual Studio 6 and the XP styles. You could try deleting/renaming the .manifest file which is in the textcrawler program folder - this will force it to default to a standard Windows 2000 theme.

Jo�o - You can't at the moment. I'll stop it popping up in the next version!
Edit
13 Aug 2007 07:47
Mac
Checkbox labels It was indeed the .manifest file. Renamed it and now the text labels display properly.
Thanks for the prompt reply

Mac 14 Aug 2007 08:47
AbteriX
Find multi lines I just had the need to find and delete multi lines like:


<A HREF="http://www.rgagnon.com/" TARGET="_top"><IMG SRC="../images/realhowto.gif"

ALT="Jump to Real's How-to Main page" BORDER="0"></A>



But i had to do this in two steps, first
a href---till---.gif
second
alt ---till---/A>
Or i had to think about an RegEx.


Would be nice if "Search and Replace"
multi line without RegEx will be implemented ;-) 16 Aug 2007 15:06
AbteriX
Select All I just had the need to select all but not a few.

e.g. i had twenty files
but want to replace in 17 only.
Market files only checked.

But it take some time to mark the wanted files.

Maybe you can add "Select All Ctrl+A"
and maybe even "Invert Selection" ?

Thank you very much DV. 16 Aug 2007 15:09
AbteriX
Long line I Just want to find and delete a long line.

But this line was 1040 Chars long.
This was to long for TC, it just cuts
the search string to 255 chars.

Maybe you could implement an array to
store long lines longer than 255 chars
and make an

For i = 0 To UBount(array)
WHILE array ! = ""
SearchString is array(i)


? 16 Aug 2007 15:19
Abterix
EOL converter Sorry, it's me again.

TextCrawler have problems
to handle files with UNIX line ending.

Maybe you want to detect this and
inform the user if he try to work an such files?

Even better if you ask to convert the EOL
for the user ;-)

bye 17 Aug 2007 19:38
DV
Unix Hi Abterix
Was the problem with the unix files with the search/replace operation or with the preview window? It should be able to handle unix files ok so I'd be interested to test it with your file. 20 Aug 2007 18:03
AbteriX
Unix Thanks for your interest.

I have downloaded HTML files from
http://64.18.163.122/rgagnon/howto.html

Like
http://64.18.163.122/rgagnon/wshdetails/wsh-0004.html



Then i use TextCrawler
to search and replace
the last lines of this file, that are:

FROM: <SMALL><div....

TILL: ....</script>


Problem:
i got always a message that nothing was found
(or like that)

My post before are related to this s&r too.

If you have more questions or need details
i will test this again and post it for you.

best regards 21 Aug 2007 09:24
DigitalVolcano
Matches How about:

<SMALL><div[\s\S]*</script>

In VBScript/Java regexes, used by TextCrawler, the dot (.) doesn't match newlines.
Edit
21 Aug 2007 14:12
AbteriX
Matches Very interesting RegEx!
I was not aware of this. Tricky ;-)
Thanks for sharing.

Now i was able to find and delete this part.
And it was NO issue with unix line ending,
sorry to bother you.


I have now add this to my Regex.txt:

Find block (replace START and END with your expr)
START[\s\S]*END


Thank you very much! TC works great. 21 Aug 2007 15:25
DigitalVolcano
Update TextCrawler 1.0.4 is now available for download-

Changelog:
Removed max size limitation in combo boxes,
Optimised form layout,
Resizable File and preview windows,
Store Replace texts in RegEx library,
Store window settings,
Right-click Context menu in file window.
Multi-select in file window
Sort columns/marked files bugfix.
No splash after first run.

You might want to back up your regex.txt file before installing just in case it get overwritten (hopefully it shouldn't)

modified: 30 Aug 2007 19:35 GMT

modified: 31 Aug 2007 18:56 GMT
Edit
30 Aug 2007 19:34
Stefan
Thank you Very nifty improvements, well done.
Thank you very much.

I hope i can test it soon productively. (are you still interested on feature request or do you need a break?) 31 Aug 2007 20:47
command line
sentenza Thank you for this wonderful tool.

A couple of future request:
it would be great to have command line option to preset a directory, so one may add on explorer right click menu to call textcrawler on selected directory.

And please I think the replace is too dangerous to left open on default, you could add a checkbox or something to enable the replace box/button when you need? Most of the time you just need to search...
Seen the power of the replace option, if you make a mistake on a tree of text files or sources, you could do real damages

Thanks. 06 Sep 2007 11:00
DC
ideas Some good ideas. I will probably add some kind of command line support to the next release!

thanks. 09 Sep 2007 07:36
DigitalVolcano
tyest test
Edit
19 Sep 2007 18:09
Stefan
Great Today i used Text Crawler again
and it works very well.

Thank you!
Stefan 19 Sep 2007 18:29
Mihai Streinu
\n\r in Replace Hello,

I tried to use TextCrawler to do the following:
- find each line that starts with a constant string ('linestart') then has a variable sentence between " (double quotes) that starts with a constant sentence start string ('sentencestart')
- replace this one line with two lines:
- the first line would have to add a constant word ('cword') preceded by a space at the end of the sentence between "s
- the second line would start with a second constant string, different from the one searched for ('linestart2') and end with the original sentence between "

I define a sentence as any sequence of letters (small or capital), digits, spaces, dashes or underscores.

To get two lines in the replaced text, I tried to put \r\n in the Replace, between the two lines of text.
But TextCrawler puts \r\n literally in the output, instead of inserting the carriage return and newline special characters.

Here are the details of my regexp:

SEARCH: linestart "sentencestart (([a-z]|[A-Z]|[0-9]|_|-|\s)+)"

REPLACE: linestart "sentencestart $1 cword"\r\nlinestart2 "sentencestart $1"


FYI, the very same operation works as expected in EditPadPro.


Thanks!
Mihai 20 Sep 2007 11:19
DigitalVolcano
\n\r replace As of the current version (1.0.4) TextCrawler doesn't recognise control characters in the replace (\n, \r, tab etc). (See Issues and Future Plans in docs)

It did work like this originally, but I took it out as it could cause confusion with situations where you literally want to put in the text "\n" etc. In the next version I hope to put this back in with some kind of option, once I work out the best way of doing it.
Edit
20 Sep 2007 12:01
stefan
\n > I hope to put this back in with some kind of option,
Great

> once I work out the best way of doing it.
Why not using the standard?

I mean \n gives an \n

But with []RegEx ticked on \n gives an new line.
And if you escape the back slash with \\
then \\n gives \n literally.

So people who are familiar with RegEx would know
what to do. Others must RTfM anyway 20 Sep 2007 20:37
Mihai Streinu
\n\r in Replace I agree with Stefan, what he described is how it should work.
Whenever this enhancement is added, you might want to put his brief explanation in the help.
Thanks a lot!
Mihai 21 Sep 2007 10:26
sylvanie
suggestion Hello,
I like the sub menu by right click.
But i find that a sub menu like "open this file with another program" is missing.
thx a lot to have made this soft ! 22 Sep 2007 22:38
DigitalVolcano
Update v1.0.5 Thanks to all for your suggestions - here is update 1.0.5!

1.0.5 - Stop Search button
Control characters in reg ex replace string (/r /n /t //)
Get start folder from windows command line (ie. can use sendto from explorer)
Cursor key preview fix
Edit
24 Sep 2007 17:30
stefan
Update v1.0.5 Many thanks DV!

BTW:
In your post and in the history
the RegEx back slashes \\\\
are written as normal slashes //// 24 Sep 2007 19:11
stefan
replace with \n 1.05 Test

Replace with two times \n didn't work.

Search RegEx: the
Replace RegEx: the\n\n

Result:
the
\n

the second \n is inserted literally instead of making
two line feeds.

-------

And maybe you can implement an option
to do an test run as preview, i.e. search and replace
with ONE selected file only.
Then open the temp result as preview with win default app for that extension. 24 Sep 2007 19:57
DigitalVolcano
bug ouch, ok - slight bug - think I've fixed it and will upload an update later (will probably stay at v1.0.5 though)

thanks for pointing it out!
Edit
25 Sep 2007 12:16
DigitalVolcano
Update Fixed version 1.0.6 out now!

# 1.0.6 - Open With... option in right-click file context menu
RegEx Test button/expanded test form
Special codes bugfix
Minor aesthetic fixes/bugfixes


Edit
29 Sep 2007 09:36
pstein
TextCrawler stop imm When I start a search/replace with TextCrawler over my whole hard disc with approx 300000 files the this lasts a while (> 3 minutes).

When I hit the STOP button then TextCrawler continues running for a while. Could you make it stopping immediately ?

Thank you
Peter 09 Oct 2007 15:12
DV
Stop button I'll have a look into improving the 'stop' performance in the next version- it's difficult to stop while in the middle of scanning a large file though.
User avatar
DigitalVolcano

Post by DigitalVolcano »

Hi,

Thank you for this great tool, it makes my life easier
I have created some reg ex in my favorites that I have sorted by order of execution. Indeed, some of them need to be executed before others, etc. I have 64 reg ex registred so far...
Now I think that you guess my idea...is there any way to implement a feature that could check all the reg ex in the RegEx.txt file and launch them from the first one to the last one?

So, your software can work like a script!!!
You could even found a way to be used through a command line

Again THANK YOU!!!

Zan2b

Posted: Feb 07, 2008 8:35:16 am
User avatar
ulopez

Post by ulopez »

witch regular expression I can use to eliminate blank lines before and after a text?
Post Reply