Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Myyco.com Shop: Golden Teacher Liquid Culture For Sale

Jump to first unread post Pages: 1
InvisibleBoom
just a tester
Male
Registered: 06/16/04
Posts: 11,252
Loc: Cypress Creek
Help me, batch file gurus!
    #6713806 - 03/26/07 06:21 PM (17 years, 1 month ago)

I know this is 100 times easier in Linux..but I want to make a script for windows that simply searches and replaces xml tags

like I changed my mind about calling some element <apple> and now want all of the <apple> (and </apple>) tags to says <banana>

I realize this would be a lot easier and whatnot if I downloaded the SED port for windows, but this needs to run on unmodified windows machines. I don't know shit about batch files, really


If anyone off the top of their head knows a simple way to do this, lemma know! thanks

Extras: Filter Print Post Top
Offlineklassasin
La vida es buena! Disfrutala!
Male User Gallery


Registered: 10/05/06
Posts: 55
Loc: Midwest. USA
Last seen: 1 year, 13 days
Re: Help me, batch file gurus! [Re: Boom]
    #6713816 - 03/26/07 06:25 PM (17 years, 1 month ago)

This may help

Otherwise, I don't know of any simple methods to use. Ports (SED, Grep) would be easier, but you have already said that is impossible. Batch files aren't really that useful. I <3 Linux (Slackware!) for that reason.

Extras: Filter Print Post Top
InvisibleDiploidM
Cuban


Folding@home Statistics
Registered: 01/09/03
Posts: 19,274
Loc: Rabbit Hole
Re: Help me, batch file gurus! [Re: Boom]
    #6713938 - 03/26/07 07:11 PM (17 years, 1 month ago)

Get awk.


--------------------
Republican Values:

1) You can't get married to your spouse who is the same sex as you.
2) You can't have an abortion no matter how much you don't want a child.
3) You can't have a certain plant in your possession or you'll get locked up with a rapist and a murderer.

4) We need a smaller, less-intrusive government.

Extras: Filter Print Post Top
Offlinedelta9
Active Ingredient
Male

Registered: 10/28/04
Posts: 5,390
Loc: California
Last seen: 13 years, 6 months
Re: Help me, batch file gurus! [Re: Boom]
    #6715668 - 03/27/07 04:35 AM (17 years, 1 month ago)

Quote:

Booooom said:
I know this is 100 times easier in Linux..but I want to make a script for windows that simply searches and replaces xml tags

like I changed my mind about calling some element <apple> and now want all of the <apple> (and </apple>) tags to says <banana>

I realize this would be a lot easier and whatnot if I downloaded the SED port for windows, but this needs to run on unmodified windows machines. I don't know shit about batch files, really


If anyone off the top of their head knows a simple way to do this, lemma know! thanks



You could write a semi-complicated script in JScript or VBScript (shudder!), BUT it would work on most every stock windows post 98 if done properly. String search and replace are common programming functions and good excersizes if you are interested in learning, but I think you just want to get things done, in which case you should download a program that automatically does batch search and replace (and there are MANY). If you want to mess around with it, I recommend JScript over VBScript unless you already know VB, VBA, or VBScript and are unfamiliar with JScript, Java, or C/C++/C#/PHP ; though if you REALLY want to learn to program I recommend writing it in C or C++ as you will have the most direct access to the windows API and it will work on practically every version of windows on the same architecture and be much faster than the script version.


--------------------
delta9

Extras: Filter Print Post Top
OfflineSeussA
Error: divide byzero


Folding@home Statistics
Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 3 months, 8 days
Re: Help me, batch file gurus! [Re: Boom]
    #6715741 - 03/27/07 06:34 AM (17 years, 1 month ago)

load the file up in vi and type...

:%s#</apple>#</banana>#g
:%s#<apple>#<banana>#g
:wq

You can of course script this through ed instead, if you need to batch it... or use sed for that matter... Unix is your friend...  :smile:

Since you are on windows, you will need to install something like cygwin first.

Extras: Filter Print Post Top
Jump to top Pages: 1

Myyco.com Shop: Golden Teacher Liquid Culture For Sale


Similar ThreadsPosterViewsRepliesLast post
* Batch file renaming nugjug 494 3 08/31/07 02:53 AM
by IrishTemper
* Microsoft's Really Hidden Files. Lana 7,926 18 07/11/02 02:14 PM
by Lana
* Deleting a file sercurely daussaulit 1,958 13 08/03/03 04:31 PM
by Meph
* OS with support for encrypted file systems? OJK 1,216 9 07/06/06 06:07 AM
by OJK
* Deleting files VisualLearner 804 9 02/08/08 11:30 AM
by WhiskeyClone
* linux file system troubles monoamine 964 7 05/22/04 01:55 AM
by AhronZombi
* Burning .iso image files or video_ts folder to play on standalone DVD player Trav 1,122 4 06/18/06 04:07 PM
by Trav
* Sending large files through email ShroomismM 1,910 11 11/29/03 04:48 AM
by Anonymous

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
588 topic views. 0 members, 0 guests and 1 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.023 seconds spending 0.004 seconds on 12 queries.