Searching/replacing in the last line of file

Tool for Search and Replace across multiple files.
fernandocg
Posts: 1
Joined: Tue Aug 23, 2011 10:51 am

Searching/replacing in the last line of file

Post by fernandocg »

Hello, i need help, i want to search and replace in a file but only in the last line of the file, it's posibble??

Many thanks.

Fernando.
User avatar
Fool4UAnyway

Re: Searching/replacing in the last line of file

Post by Fool4UAnyway »

Yes, it's possible.

Use the EOF (End of File) anchor $. Anything before that is definitely on the last line, unless it is an empty line. You might want to use something like matchpattern\r\n$
Post Reply