Go Back   TalkBass Forums > Bass Guitar Forums > Bass Guitar Forums > Off Topic [BG]
Register Rules/FAQ/CUP Members List Search Today's Posts Mark Forums Read

Off Topic [BG] Non-music-related discussion and chat


Supporting Membership
Thank You

Latest Supporting Member
Donate to Upgrade Today

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-18-2008, 02:28 PM
Registered User
 
Join Date: Jul 2006
Location: Modesto, CA
Send a message via AIM to jady Send a message via Yahoo to jady
Anyone here know how to write batch files (.bat)?

Sign in to disble this ad
I need a batch file that will take all of the txt files in a directory and replace all of the "SEQ" and "ESQ" entries with ";" and place a carriage return after the "END" statement.

Anyone????
__________________
Gallien-Krueger Club #695
myspace.com/johnadybassist
  #2  
Old 07-18-2008, 03:41 PM
Registered User
 
Join Date: Dec 2007
Location: Memphis,Tn
Suggestion (but time consuming)

find <text string with quotes and no brackets> *.* > results.txt

That will put your results into a text file named results.
Open it in notepad, use replace command for each instance?


There are third party tools that do this; I'm not sure you can batch that out, without an external program...

try SED from the unix library....

http://en.wikipedia.org/wiki/Sed

Last edited by Georynn : 07-18-2008 at 03:51 PM.
  #3  
Old 07-18-2008, 05:58 PM
Registered User
 
Join Date: Jul 2003
Location: NET
Do you mean a legacy DOS batch file? Well, it could be done, even if it's a little fiddly. Why not just use a text editor that has the command 'Find/Replace In Files'?.
__________________


Last edited by cdef : 07-18-2008 at 06:19 PM.
  #4  
Old 07-18-2008, 06:13 PM
Registered User
 
Join Date: Jul 2006
Location: Modesto, CA
Send a message via AIM to jady Send a message via Yahoo to jady
Quote:
Originally Posted by cdef View Post
What OS? You might use a text editor that has the command 'Find/Replace In Files'.
Win XP


I am using a batch replace program right now but I was hoping to automate it to a click instead of manually typing everything into the program.

I have to fix the code in hundreds upon hundreds of programs a day.......
__________________
Gallien-Krueger Club #695
myspace.com/johnadybassist
  #5  
Old 07-18-2008, 06:33 PM
Registered User
 
Join Date: Jul 2003
Location: NET
I'd suggest EmEditor. You can easily define very powerful macros to batch search & replace whatever text at one click. Plus, it has syntax highlighting for many programming languages. Free in this version (6.00.4). The latest shareware version is here.
__________________


Last edited by cdef : 07-18-2008 at 07:50 PM.
  #6  
Old 07-18-2008, 09:39 PM
Registered User
 
Join Date: Jan 2008
Location: Westfield, MA, USA
With WinXP out of the box I have no idea. If you are willing to either install the Cygwin package of Unix utilities or Perl the problem is trivial.
  #7  
Old 07-19-2008, 07:50 AM
Registered User
 
Join Date: Aug 2007
Location: Boston Area
Supporting Member
You could try edlin

Quote:
Originally Posted by jady View Post
I need a batch file that will take all of the txt files in a directory and replace all of the "SEQ" and "ESQ" entries with ";" and place a carriage return after the "END" statement.

Anyone????

Hey Jady,

As others have mentioned installing cygwin or some other Unix like tool set (that contains the sed utility) would be good. Perl is also great for this type of thing. Personally this is something I would do with Ant (with Ant contrib). A really nice build tool/utility.

If you must use batch files I think you can use edlin to perform the search/replace. edlin is an old line editor included with DOS and it seems to still exist in Windows. I have it here on Vista so I assume it is included with previous Windows versions as well. edlin has an R option for replace.

If you search google for "dos batch edlin search replace", you'll get some useful info.

hth.
--ryano
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Follow TalkBass on Twitter   Visit TalkBass on Facebook  

All times are GMT -6. The time now is 10:24 PM.




Copyright 2011 Talk Music Group Inc. All rights reserved.
Play guitar? Visit our new sister site TalkGuitar.com [beta]
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.