Welcome Guest.   Make a donation to an author on the site July 28, 2014, 03:30:47 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Simple free commandline text search and replace tool?  (Read 12545 times)
mouser
First Author
Administrator
*****
Posts: 33,183



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: November 28, 2008, 10:25:10 AM »

I'm looking for a really simple commandline search and replace tool, which can be run non-interactively and told to find and replace a string in a text file.
Any suggestions?
Logged
Veign
Charter Honorary Member
***
Posts: 993



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: November 28, 2008, 10:31:25 AM »

My Seeker application has command line support.
Logged

mouser
First Author
Administrator
*****
Posts: 33,183



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: November 28, 2008, 10:43:32 AM »

Wow when did that come out Veign -- i don't remember you posting about it.  Looks cool !
Logged
Veign
Charter Honorary Member
***
Posts: 993



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: November 28, 2008, 10:53:38 AM »

Been working on it for a couple years now.  Its what I use to manage websites as its dead simple for me to locate text within a large website project.

Whats kinda neat about Seeker is the four reporting methods and the native search for Word documents and Excel spreadsheets (will tell you what sheet within a workbook a text string was located).
Logged

mouser
First Author
Administrator
*****
Posts: 33,183



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: November 28, 2008, 10:57:55 AM »

yeah the native search is pretty damn cool.
Logged
Veign
Charter Honorary Member
***
Posts: 993



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: November 28, 2008, 11:02:21 AM »

There are some things I need to get working better.  If you watch the status bar you will see how fast it searches (in memory) but how slow it is at generating the report display (especially the detailed report).  Writing to any kind of display memory is slow and I need to virtualize the display where its only loading into the display memory what is actually being shown to the user and not the full report.

Also, the right click on the detailed report will only work properly if the files are in the same folder.  There is no mechanism to use the Explorer right click menu when files span different folders - at least that I know of.

Oh and the Help file is not that good - I hate writing help files...
« Last Edit: November 28, 2008, 11:06:32 AM by Veign » Logged

gexecuter
Supporting Member
**
Posts: 252


Move over and give us some room...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: November 28, 2008, 06:41:44 PM »

Fart only has a command line interface so you should check it out. I haven't tried it yet because i am pretty bad with command line interfaces and i am afraid i might screw something up  Sad
Logged

Mouser is made of win and awesome!
rjbull
Charter Member
***
Posts: 2,736

View Profile Give some DonationCredits to this forum member
« Reply #7 on: December 01, 2008, 04:16:47 AM »

MiniTrue, A. Pipkin's "Ministry of Truth" (MT) utility.  On NO ACCOUNT overlook Eric Pement's third-party comments on it.  Go to his SED page and page down until you get to Console/command-line apps.  Direct link to his extra document here.  You need to know about its misbehaviours and workarounds.  I use it successfully under XP, but only with short file names.
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: December 01, 2008, 04:48:00 AM »

rjbull: Eek, using 16bit dos executables under win32? Why haven't you searched for a replacement tool? smiley
Logged

- carpe noctem
rjbull
Charter Member
***
Posts: 2,736

View Profile Give some DonationCredits to this forum member
« Reply #9 on: December 01, 2008, 07:57:37 AM »

rjbull: Eek, using 16bit dos executables under win32? Why haven't you searched for a replacement tool? smiley

It's free, and, for my use, it works.  "My use" is mostly dealing with files made by DOS editors, and I use those because I'm familiar with them and because they're WordStar-style.  Also it's surprisingly hard to find a free Windows editor that does automatic *.BAK back-ups and has bookmarks.

I do have a Win32 search-and-replace tool now - HFFR Text WorkBench.  Just checked the Help file, and as well as GUI it has command-line support, though I've not had cause to use it yet.  Does Unicode, too.

[Edit]  Oops, just remembered this is about "free" apps.  HFFR Text WorkBench is payware.  You can still find the last free version, but I don't think it accepts command line arguments and it only does a single search-and-replace pair.  That was another of the advantages of MiniTrue, many pairs.
[/Edit]



« Last Edit: December 01, 2008, 10:24:12 AM by rjbull » Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: December 01, 2008, 08:27:45 AM »

I was just wondering smiley - DOS programs have a disadvantage running under windows since they need some virtualization... and won't run at all under 64bit windows (outside of full emulation, like dosbox). I still use plenty of console applications, but it's been several years since I've used anything 16bit. Seems like the 32bit version is DJGPP, no wonder it's quirky on NT based operating systems then smiley
Logged

- carpe noctem
Rover
Master of Smilies
Charter Member
***
Posts: 628



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: December 01, 2008, 01:46:35 PM »

I have used this before and found it more than adequate.  Thmbsup

GSAR:  GSAR Project Page

Quote
gsar (General Search And Replace) is a utility for searching for and --- optionally --- replacing strings in both text and binary files. The search and replace strings can contain all kinds of characters (0--255), i.e. Ctrl characters and extended ASCII as well.

The algorithm used is a variation of the Boyer-Moore search algorithm, modified to search binary files. As a result of this, gsar is blindingly fast.

Opposed to line oriented search programs (like grep(1)), gsar will find all matches on a line. Actually, gsar doesn't know anything about lines at all, all files and strings are treated as binary.

Gsar can search one or several files for a string and report the occurrences. Gsar can read one file, search for a string, replace it with some other string, and create a new file containing the changes. Gsar can perform a search and replace in multiple files, overwriting the originals. Finally, gsar can work as a filter, reading from standard input and writing to standard output.
Logged

Insert Brilliant Sig line here
rjbull
Charter Member
***
Posts: 2,736

View Profile Give some DonationCredits to this forum member
« Reply #12 on: December 02, 2008, 03:36:51 AM »

I have used this before and found it more than adequate.  Thmbsup

GSAR:  GSAR Project Page

I'd forgotten that one, even though I still use the DOS version - and it's a good one, too.  But again, unless they've updated it, it will only do one search/replace pair at a time.  When I wanted multiple pairs to use as a user-defined tool in TED Notepad and in ClipboardHelp+Spell, I ended up using SED.

Logged
skas
Supporting Member
**
Posts: 4

View Profile Give some DonationCredits to this forum member
« Reply #13 on: December 02, 2008, 07:58:12 AM »

Why not use something like GNU grep? It's strictly command-line, and it can be set for silent mode too. Download and/or read documentation at: <http://www.gnu.org/software/grep/>

But if you want an app that provides an easy-to-use GUI for building & saving sets of search-replace operations -- which you can then call from a command-line -- consider BK ReplaceEm.

This 32-bit Windows freeware application hasn't been supported or distributed by its developer Bill Klein (BK) for a number of years. But it was once considered among the very best search-n-replace apps (free or not). And I think it still deserves such consideration.

For a rather complicated example of the very sort which originally inspired BK to create his application, see: <http://www.ccp14.ac.uk/ccp14admin/bkreplacem/index.html>.

But the download URL on the latter webpage is dead. To download it, you must use an archive website like SnapFiles: <http://files.snapfiles.com/localdl834/bkrep20.exe>.

It's a very safe program to install & try -- it just puts its files in a single folder w/o any changes to the registry, as I recall.

With BK ReplaceEm, you use replace groups and file sets.

A replace group consists of a series of search & replace strings (regular expressions & 'range replacements' are supported, and any series of simple boolean operations can be input & saved via the GUI too).

A file set consists of a single file, multiple files, or a whole directory  -- perhaps filtered by particular file extensions. Whatever.

You can have the program create a backup copy of every file it operates on, in case things don't go as you expected.

You can have the program output to different locations too. And if you want, you can set the application to run additional -- and different -- replacement operations on all files found in that second location. Logs can be generated too.

I hope that's an accurate description. It's a been a while since I've used it. I invested in the very expensive TextPipe Pro a couple years ago, which, I think is the application BK ReplaceEm most resembles.

BTW, anyone interested in search & replacement operations would be well-served by Friedl's book, 'Mastering Regular Expressions', now in its 3rd edition from O'Reilly. I'm not a programmer, but this book has helped me greatly in parsing & editing text, in website development & maintenance, even in finding & managing files on my desktop PC -- all via the numerous applications that now support Perl & other varieties (like grep) of regular expressions.

Steve
Logged
rjbull
Charter Member
***
Posts: 2,736

View Profile Give some DonationCredits to this forum member
« Reply #14 on: December 02, 2008, 10:32:41 AM »

But if you want an app that provides an easy-to-use GUI for building & saving sets of search-replace operations -- which you can then call from a command-line -- consider BK ReplaceEm.

I looked through BKReplacem's command line options a while back, and didn't really understand them   embarassed  So I went with SED.  It's case-sensitive, but that was OK for what I wanted.

Logged
criss
Charter Member
***
Posts: 17

View Profile Give some DonationCredits to this forum member
« Reply #15 on: December 03, 2008, 09:02:54 AM »

Perhaps XChangeCL: http://www.sadmansoftware.com/xchangecl/

I did not try it, but I use daily their Search Program which is great and the author is very resposive.
Logged
Sundog29
Supporting Member
**
Posts: 3


View Profile Give some DonationCredits to this forum member
« Reply #16 on: May 13, 2009, 11:25:29 AM »

http://www.gnu.org/software/grep/>

But if you want an app that provides an easy-to-use GUI for building & saving sets of search-replace operations -- which you can then call from a command-line -- consider BK ReplaceEm.

This 32-bit Windows freeware application hasn't been supported or distributed by its developer Bill Klein (BK) for a number of years. But it was once considered among the very best search-n-replace apps (free or not). And I think it still deserves such consideration.

For a rather complicated example of the very sort which originally inspired BK to create his application, see: <http://www.ccp14.ac.uk/ccp14admin/bkreplacem/index.html

BK ReplaceEM seems to have been republished by ecobyte software as Replace Text v2.2 (free).
http://www.ecobyte.com/replacetext/
Logged
Ross MacGregor
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« Reply #17 on: January 23, 2013, 02:32:23 PM »

I've written just such a tool for Windows. It is easy to use yet has many features that many people eventually need. It supports Unicode, can search multiple files, and is small, fast and free.

https://sites.google.com/site/simplesearchreplace/
Logged
rjbull
Charter Member
***
Posts: 2,736

View Profile Give some DonationCredits to this forum member
« Reply #18 on: January 25, 2013, 03:17:37 PM »

I've written just such a tool for Windows.
Thanks for telling us about this.  Does the Options file allow one to enter multiple search-and-replace pairs?
Logged
Curt
Supporting Member
**
Posts: 6,307

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #19 on: January 25, 2013, 05:58:21 PM »

Quote from: SSR 2
It has the following features:

    Easy to use in Windows batch files
    Supports Windows and Unix line endings
    Unicode support
    Accepts multiple search/replace arguments
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.058s | Server load: 0.2 ]