4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Batch Find and Replace
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Aug 04, 2002 12:18 am (21 years, 8 months ago) Reply with QuoteBack to Top

I have a problem......

I have a load of .php files which all have font tags to set the color text as 3300A8, but now I want to change every single tag that says 3300A8 to 0000B1, but I don't want to go through 2,000 files manually, is there an automatic way to do this?

I've tried importing my pages into FrontPage, but it doesn't support .php for find and replace, only microsoft and standard HTML file types. So is there a command I can run to batch rename 2,000 files, so I can run this process, then turn them back to .php's?

Thanks

Justin
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Sun Aug 04, 2002 2:54 am (21 years, 8 months ago) Reply with QuoteBack to Top

You can use TextPad or UltraEdit, they both are wonderful text editors with syntax highlighting for many languages and have replace all facility for all file types. You can can make a script in Perl/PHP to do the same, using regular expressions.

If you are keen to use Microsoft only, then if you have Windows XP, it can do multiple renaming. If 9X/ME/2k go to command prompt and type ren *.php *.htm and when you have changed the things ren *.htm *.php

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Aug 04, 2002 1:33 pm (21 years, 8 months ago) Reply with QuoteBack to Top

jayant wrote:

If you are keen to use Microsoft only, then if you have Windows XP, it can do multiple renaming. If 9X/ME/2k go to command prompt and type ren *.php *.htm and when you have changed the things ren *.htm *.php

Unfortunatley I'm on Windows XP Pro, so I can't do the Command Prompt command that I would usually use, how would I do multiple renaming with Windows XP - I know it's probbably got an obvious answer but I don't know it! Sad
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Ben
Senior WebHelper
Senior WebHelper


Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK

PostPosted: Sun Aug 04, 2002 2:08 pm (21 years, 8 months ago) Reply with QuoteBack to Top

start>run>cmd

ren with wildcards works fine in XP pro, I use it all the time

________________________________
Ben Scott

Red and White Kop
OfflineView User's ProfileFind all posts by BenSend Personal MessageSend emailVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Aug 04, 2002 2:53 pm (21 years, 8 months ago) Reply with QuoteBack to Top

doesn't here, but thats probbably because my build of XP is not completely *cough* legal, I'm sure MS know about this 'cos I can't get on Windows Update.

Anyway, I used TextPad in the end, and found it really useful, and really good, and the find and replace features in that are excellent!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
savagegal
Junior WebHelper
Junior WebHelper


Joined: 04 Aug 2002
Posts: 6

PostPosted: Sun Aug 04, 2002 4:46 pm (21 years, 8 months ago) Reply with QuoteBack to Top

Justin wrote:
doesn't here, but thats probbably because my build of XP is not completely *cough* legal, I'm sure MS know about this 'cos I can't get on Windows Update.

Anyway, I used TextPad in the end, and found it really useful, and really good, and the find and replace features in that are excellent!


I am also on similar version of XP Pro but I can go on windowsupdate and command prompt is also there Smile
OfflineView User's ProfileFind all posts by savagegalSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sun Aug 04, 2002 6:39 pm (21 years, 8 months ago) Reply with QuoteBack to Top

even though you couldn't have accessed the command prompt, would it have been possible for you to create an MS-DOS batch file?

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Aug 04, 2002 6:48 pm (21 years, 8 months ago) Reply with QuoteBack to Top

'RENAME' is not recognized as an internal or external command,
operable program or batch file.

'REN' is not recognized as an internal or external command,
operable program or batch file.

Getting into DOS wasn't the problem, getting the command to work was!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sun Aug 04, 2002 6:52 pm (21 years, 8 months ago) Reply with QuoteBack to Top

oh, I misunderstood! Did you try "move" or "mv"?

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
JointComms
WebHelper
WebHelper


Joined: 03 May 2002
Posts: 79
Location: Windsor, CANADA

PostPosted: Mon Aug 05, 2002 1:16 am (21 years, 8 months ago) Reply with QuoteBack to Top

Note tab lite is excellent for what I understand your needs to be.

www.notetab.com
OfflineView User's ProfileFind all posts by JointCommsSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.135115 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme