How can you search and replace text in multiple files on an FTP server?

Basically I need to change the Google Analytics information on a bunch of plain old HTML pages and I'm wondering if there is a way to do it without having to download all of the files, do the search and replace locally and then FTP them back.

link|improve this question
3  
Don't forget that FTP is only a file transfer protocol, so it's meant for transferring files to your computer and back. Even when you view a remote file, it is temporarily transferred to your computer before. Is there any reason why you'd not want to download the files and sync them back? – slhck Jul 13 '11 at 20:54
feedback

3 Answers

You may be able to do this with putty if you have telnet access to the server as well as ftp. Then, depending on if you are on a linux or windows server, you'd use the appropriate command line text editor to modify the files.

link|improve this answer
feedback

As the comment says, ftp doesn't allow this. You probably really want the 'download all, replace, upload back'.

The best I can think of is an editor that understands ftp. Behind the scenes, it's downloading the file, editing it locally, and then uploading, but maybe this 'invisible background ftp' is what you want. I don't know if any do multiple files though. There are individual programs that can do this, and I think any true KDE editor (e.g. kate) can do this through KIOSlaves.

link|improve this answer
feedback

Windows can map a ftp site to a drive letter, at least in XP, Linux has curlftpfs, which can mount a ftp site.

Either options is really downloading and updating in background after any file is edited. Not the ideal solution. I'd personally write a script to do the updates. However, if it's only to be done once, use what ever might work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.