Unicode Editor with Search and Replace

General MSTS related discussion that doesn't really fit into any of the other specific forums.

Moderator: Moderators

BobLatimer
Very Active Forum Member
Posts: 2765
Joined: Mon Jan 07, 2002 12:00 am
Location: Auckland, New Zealand

Unicode Editor with Search and Replace

Post by BobLatimer »

I'm looking for a Unicode editor that will do a search and replace, i.e. I want to point it at a folder, have it search every file in that folder and its sub-folders for a specified string and then replace it whenever it finds it.

Does anyone know of an editor that will do this?

I'm planning to change my sound and cab aliasing and want to change, for example, every occurrence of "../../CommonSounds/ to "../../../../CommonSounds/ in every file in the Trainset folder.
User avatar
dforrest
Very Active Forum Member
Posts: 6187
Joined: Wed Jun 05, 2002 12:00 am
Location: St. Vincent and the Grenadines (and in an earlier life, Hull)

Post by dforrest »

TexPad from Helios Software Solutions will do all of that and more. Available at http://www.textpad.com/

An evaluation copy is available.
BobLatimer
Very Active Forum Member
Posts: 2765
Joined: Mon Jan 07, 2002 12:00 am
Location: Auckland, New Zealand

Post by BobLatimer »

Thanks mon.
BobLatimer
Very Active Forum Member
Posts: 2765
Joined: Mon Jan 07, 2002 12:00 am
Location: Auckland, New Zealand

Post by BobLatimer »

Had a look at Textpad.

As far as I could figure out, it will do a "Replace" in the current open file(s) and will do a "Find in Files" and find the occurences in all files in a specified folder.

What I want to do is a "Replace in Files" i.e. point it at the Trainset folder and tell it to replace one particular string with another in all the files in that folder. It doesn't appear to do that.

Have I missed something?
User avatar
mikesimpson
Very Active Forum Member
Posts: 6361
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Post by mikesimpson »

Hi Bob,

I always use Ultra-Edit for my editing. It includes a Replace in Files item which also has a unicode option, so should do everything you need.

See http://www.ultraedit.com - it is shareware, but I think its the best you can get.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
BobLatimer
Very Active Forum Member
Posts: 2765
Joined: Mon Jan 07, 2002 12:00 am
Location: Auckland, New Zealand

Post by BobLatimer »

Thanks Mike. I'll give it a go.
User avatar
numnutz
Established Forum Member
Posts: 302
Joined: Mon Dec 03, 2001 12:00 am

Post by numnutz »

Word for Windows will do this :lol: - also Dreamweaver I belive does this (don't know about the unicode support though)
Roger
Getting the hang of things now
Posts: 12
Joined: Thu Feb 07, 2002 12:00 am

Post by Roger »

latimers - I think you may find a freeware program called Agent Ransack can do what part of what you want. It will search a defined set of directories for a text string, and then display the results in an Explorer-style window. You can then open each listed file found in your Unicode editor and use its own search and replace function - I find Editor2 (also free) is very good for this as a more powerful alternative to Wordpad.

http://www.agentransack.com
http://netez.com/2xExplorer
User avatar
kimdurose
Established Forum Member
Posts: 304
Joined: Fri Nov 09, 2001 12:00 am
Location: East Midlands, UK
Contact:

Post by kimdurose »

Wordpad will do it too.
Kim Durose
http://www.kimsim.co.uk
"British Railways Projects for Microsoft Train Simulator"
<IMG SRC="http://album.atomic-systems.com/showPic ... Kimsim.jpg">
User avatar
Fodda
Very Active Forum Member
Posts: 6157
Joined: Fri Feb 22, 2002 12:00 am
Location: Bristol, England

Post by Fodda »

There's a brand new file in the 'other place' called unischv1.zip I quote

"Searches selected path and subdirectories for files that contain specified content. Works on Ansi, Unicode, Unicode Compressed and ZIP file contents. Requires MSTS intalled. By Martyn T. Griffin"

Not sure if it'll do all you want, but as it's MSTS specific, it could be well worth looking at.
User avatar
dforrest
Very Active Forum Member
Posts: 6187
Joined: Wed Jun 05, 2002 12:00 am
Location: St. Vincent and the Grenadines (and in an earlier life, Hull)

Post by dforrest »

latimers wrote:Had a look at Textpad.

As far as I could figure out, it will do a "Replace" in the current open file(s) and will do a "Find in Files" and find the occurences in all files in a specified folder.

What I want to do is a "Replace in Files" i.e. point it at the Trainset folder and tell it to replace one particular string with another in all the files in that folder. It doesn't appear to do that.

Have I missed something?
1. Open all the files you wants to change

2. Manu item Search | Repace (also on toolbar)

3. Type in the two strings, choose "All documents" and click on "Replace All"
BobLatimer
Very Active Forum Member
Posts: 2765
Joined: Mon Jan 07, 2002 12:00 am
Location: Auckland, New Zealand

Post by BobLatimer »

Thanks for all of the suggestions.

Being basically lazy or too busy or something, the thought of manually opening 2,000 or so .eng and .wag files didn't appeal to me.

The solution was Ultra-Edit as suggested by Mike Simpson.

Using it, all you need to do is enter old string, new string, type of file (*.eng, *.wag) and highest level folder (Trainset), tick Unicode and include subfolders (or something similar). Once you hit Go, it warns you you might be about to do significant damage to your files. If you continue despite that, it does the job. Very useful.

Not only that, my restructured aliasing works!

For anyone that's interested, I moved my CommonSounds and CommonCabs folders to the Train Simulator folder, so had to change the references in the .eng, .wag and .cvf files. The reason for that was so that I didn't have to include a copy in each "set" of routes that I swap in and out of the Train Simulator folder. It saved me about 1Gb of space.

Thanks again Mike.
User avatar
dforrest
Very Active Forum Member
Posts: 6187
Joined: Wed Jun 05, 2002 12:00 am
Location: St. Vincent and the Grenadines (and in an earlier life, Hull)

Post by dforrest »

latimers wrote:Had a look at Textpad.

As far as I could figure out, it will do a "Replace" in the current open file(s) and will do a "Find in Files" and find the occurences in all files in a specified folder.

What I want to do is a "Replace in Files" i.e. point it at the Trainset folder and tell it to replace one particular string with another in all the files in that folder. It doesn't appear to do that.

Have I missed something?
Back to an old one!

The TextPad people have recently released WildEdit, a companion programme to TextPad which does just this. It will be invaluable for making global changes in the MSTS file hierarchy. I have downloaded it and registered it (£8.50). A limited-use evaluation version is available.

http://www.textpad.com/products/wildedit/index.html

,
ImCanadian
Getting the hang of things now
Posts: 93
Joined: Mon Feb 14, 2005 10:37 pm

Post by ImCanadian »

Latimers

What's about the ConTEXT Editor that Peter Williard is using for his MsTS. And you should check for more information on the link below:

http://steam4me.railpage.org.au/trainsi ... ntext.html

Hope that will help you to decide if that is the one you are looking for. I have not try myself yet but have read the messages through Trainsim and other train forum messages that most train simmers are using this program.

Thank you

John P. Mackay
Belleville, ON Canada eh!!
User avatar
ianmacmillan
Very Active Forum Member
Posts: 9588
Joined: Fri Feb 28, 2003 12:39 pm
Location: N. Lanarkshire Scotland

Post by ianmacmillan »

I have been using a similar idea for the last 18 months.

I put the common folders in a folder called "Aliased" in the Trains folder along with the default locos.

My locos now alias to
..\\..\\..\\aliased\\scotsman\\cabview\\etc
or
..\\..\\..\\aliased\\common.cab\whatever

My Aliased folder is now bloated to 1.9gig. This allows me to keep seperate Trainset folders for each route without duplicating too much.
I believe it also speeds up MSTS as it is not read at startup.

I edit most files manually as some files skip from one common folder to another using ..\\ Other alias to the main sound folder using ..\\..\\..\\sound or to the default loco looking for coupling compressor or fuel .wavs which are in the main sound folder.
I use Context find and replace which has the advantage of remembering previous entries.

I now include in each folder in the common folder a Sound and Cabview folder containing the aliased .cvf and sms files which I can simply copy into each loco and I delete any aliasing in the .eng file.

I'd be interested to know if any more people have the common folders in a different place.
Locked

Return to “[MSTS1] General MSTS Discussion”