I was running a few tests and thought of one I can see myself using frequently.
So I have a few files around that I would usually
source as they are common in a lot of things that I would do. I was trying to template it by removing all things after the '=' in a
Name=Value pair. This means that instead of:
I would have:
after I was done using sed to edit my files.
I've tried creating a RegExp statement to do this only remove the Values after the
= but I can't seem to create one that will match to a single
= and not multiple (e.g. match
= but don't match
This is the furthest I got before I decided to post:
Could anyone shed some insight?
I do not want it removing multiple
= as this is the commonly used formatting for comments within my team, they use them to split up data entry sections for easier reading.
Some test values:--
NameOfServer=Foo `#`========== `#` UserData `#`==========
Ideally I would like it to match the '=Foo' in the first line, but not remove the multiple '=' of the commented lines.
Note: I would be using Sed (v4.2) (also Sed within Vim for 'pattern find and replace' if that is any relevance).