I am trying to have a regular expression to find and delete those I don't need it. For example.
Summary of this topic.
Capacity: 2090
IP address: 90:400:00
Subnet mask: 255.0.555
Status: Good
ID: 1233
I only want to the whole line for capacity, IP address and I don't need the rest. But, after the colon it might be few spaces or a tab before the any number or text.
After the regex, the result should display:
Capacity: 2090
IP address: 90:400:00
ID: 1234
Status: Good
Is anyone think this is possible to accomplish?
Thanks for reading this post.
RegEx to look for word
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
it is not clear what you really want.
You write that you only want to keep lines containing capacity and ip address.
But in the result you want to hav, there are ID and status lines as well (in changed order, and with increased ID value).
If you only want to keep lines with capacity and ip:
clear all bookmarks
find capacity, mark all
find ip address, mark all
invert all bookmarks
delete bookmarked lines.
You write that you only want to keep lines containing capacity and ip address.
But in the result you want to hav, there are ID and status lines as well (in changed order, and with increased ID value).
If you only want to keep lines with capacity and ip:
clear all bookmarks
find capacity, mark all
find ip address, mark all
invert all bookmarks
delete bookmarked lines.
WHICH ENTIRE LINE?
You show four lines and tell us you need _THE_ whole line ...
You are confusing. You originally show a six-line text sample, tell us you need only the two lines containing ip and capacity, but the wanted result shows four lines (with changed order and changed content). And then you tell us you need only one line, but that line completely, and again show four lines as wanted result.
Sorry, I can't think of any way to produce a single line result containing four lines, two of which you told us you don't need ...
You show four lines and tell us you need _THE_ whole line ...
You are confusing. You originally show a six-line text sample, tell us you need only the two lines containing ip and capacity, but the wanted result shows four lines (with changed order and changed content). And then you tell us you need only one line, but that line completely, and again show four lines as wanted result.
Sorry, I can't think of any way to produce a single line result containing four lines, two of which you told us you don't need ...