How to "clean up" a file ?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Pete S.

How to "clean up" a file ?

Post by Pete S. »

I have a file which contains records in the following format:

FILE: DNTSCTA.DAT
SIZE:1025, read:1025
FILE: DNTSW2S.K01
SIZE:1024, read:1024
FILE: DNTSW2S.K03
SIZE:1024, read:1024
FILE: DNTSW2S.K04
SIZE:1024, read:1024
FILE: DNTSW2S.K05
SIZE:1024, read:1024

What I would like to do is end up with:

DNTSCTA.DAT
DNTSW2S.K01
DNTSW2S.K03
DNTSW2S.K04
DNTSW2S.K05

Any suggestions on how to do that are greatly appreciated.

Thank you.
Pete
Frank Fesevur

RE: How to "clean up" a file ?

Post by Frank Fesevur »

Hi,

Quiet easy. You place the cursor on the first line, start a macro and clean up the first part (remember to use Ctrl+Cursor and Delete Line!) After the first part be sure the cursor is at the char of the next line, stop the macro recording and play the macro for all other line.

Hope it helps,
Frank
Thomas Schremser

RE: How to "clean up" a file ?

Post by Thomas Schremser »

Use the follwoing regular expression:

Search for: FILE: \(.*\)\nSIZE:\(.*\)
Replace with: \1

HTH
Greetings
Thomas
Post Reply