Replace in read-only files

Find, replace, find in files, replace in files, regular expressions

Replace in read-only files

Postby TomS » Sun Jan 21, 2007 2:55 pm

This might belong in a different forum but...

I have a read-only file, and I want to do some replaces in it before I decide whether or not to save it (as a new file).

The "Replace" tool is not available to me when the file is read-only. Is there a way to override this? It seems silly to me that it is unavailable - UE should let me do the replace, and then when I go to quit, it should prompt me to save this new file (or discard it).

Any help appreciated.

Tom S.
User avatar
TomS
Newbie
 
Posts: 3
Joined: Sun Jan 21, 2007 12:00 am

Re: Replace in read-only files

Postby mrainey56 » Sun Jan 21, 2007 3:27 pm

Can't you just do a Save As before trying the search and replace?
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Replace in read-only files

Postby TomS » Sun Jan 21, 2007 7:43 pm

mrainey56 wrote:Can't you just do a Save As before trying the search and replace?

Yes, I could do a 'save as', but that's what I'm trying to eliminate. Basically I get a read-only file, I want to do the replace, look at it, copy some of it to the clipboard and then throw it away. If I did a save as, then I'd have to clean up (delete) that new file.

Thanks

Tom
User avatar
TomS
Newbie
 
Posts: 3
Joined: Sun Jan 21, 2007 12:00 am

Re: Replace in read-only files

Postby Mofi » Mon Jan 22, 2007 8:09 am

To delete a file from within UltraEdit you can use File - Special Functions - Delete Active File. I use Alt+Del to do that.

You can also copy the whole content of the file to a new file before editing: Ctrl+A, Ctrl+C, Ctrl+N, Ctrl+V.

I personally think, UltraEdit does it right. If a file is read-only, you cannot do any action which modifies the content. I really, really don't like the MS Office method to allow editing a read-only file and then when I want to save it, it is not possible because the file has set the read-only attribute which I have forgotten to remove before starting editing.

UltraEdit lets you set a file as read-only even if the file has not the file attribute read-only set - see Edit - Read Only. There is a special configuration setting for read-only file handling too - see Advanced - Configuration - File Handling - Miscellaneous - Change file read-only attribute when changing menu setting.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4051
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Replace in read-only files

Postby TomS » Tue Jan 30, 2007 11:26 am

I think it would be a good thing to be able to set in the options/settings. Do you want to be able to edit read-only files (and then have to save with a different name of course)?

That would make everyone happy- the people who want to and the people who don't.

Tom
User avatar
TomS
Newbie
 
Posts: 3
Joined: Sun Jan 21, 2007 12:00 am


Return to Find/Replace/Regular Expressions