help to capture some words from file
Posted: 03 Aug 2009 04:44
Hi,
I'm new in batch commands and need some help.
Let's say I have a file (test.txt) which contain these lines.
Subject: test test
To: 6597712345@sgw.abc.com
Message-ID: <OF2BFE240E.DD9201BC-ON48257607.0033BBC9-48257607.0033DD71@abc.com>
I need to capture some words from the file starting with 'To: ' and 'Subject: ' however I need to delete the @sgw.abc.com and also Subject:
So the output of the new file will be something like this.
To: 6597712345
<empty line here>
test test
The number 65**** is always the same length, which is 10 numbers.
Appreciate if any of you can help.
I'm new in batch commands and need some help.
Let's say I have a file (test.txt) which contain these lines.
Subject: test test
To: 6597712345@sgw.abc.com
Message-ID: <OF2BFE240E.DD9201BC-ON48257607.0033BBC9-48257607.0033DD71@abc.com>
I need to capture some words from the file starting with 'To: ' and 'Subject: ' however I need to delete the @sgw.abc.com and also Subject:
So the output of the new file will be something like this.
To: 6597712345
<empty line here>
test test
The number 65**** is always the same length, which is 10 numbers.
Appreciate if any of you can help.