I have a number of text files that average between 100k and 500k. Example text
<OTURN>DataId=3001559&Version=1</OTURN>
<OTSubType>749</OTSubType>
<OTLocation>1539739 2952416 3001559 </OTLocation>
<OTCurrentVersion>TRUE</OTCurrentVersion>
<OTEmailSubject>CIS: watch-process suspect process issues</OTEmailSubject>
the above will repeat but listing different " DataId=###### "
What I'm trying to do is either delete everything except the DataId values or copy the DataId values to a new file. In either case the values seperated by a comma.
Can I do this with a macro ?
Copy or delete macro
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Mark all the lines containing DataId= :
Search | Find... (<F5>):
Edit | Copy Other | Bookmarked Lines
Paste them into another document.
In the other document:
Search | Replace... (<F8>):
Search | Find... (<F5>):
Copy all the marked lines:Find what: DataId=
Mark All
Edit | Copy Other | Bookmarked Lines
Paste them into another document.
In the other document:
Search | Replace... (<F8>):
This assumes you are using Posix regular expression syntax:Find what: .*DataId=([0-9]+).*\n
Replace with: \1,
[X] Regular expression
Replace All
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax