Replace from a word through 9 lines

General questions about using TextPad

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

Post Reply
bbri
Posts: 2
Joined: Mon Jan 09, 2012 8:57 pm

Replace from a word through 9 lines

Post by bbri »

I would like to find an expression and then delete the line it is on and the following 9 lines.

Example:

Warehouse: 1001

Qty sold: 100
Profit: 100
COG: 100


Qty Rtrn
Qty canc
Sold

Lines I want to keep...

I would like to replace the "Warehouse" line and the next 9 lines that could change.

Any help would be greatly appreciated.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: ^Warehouse: .*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n
Replace with: [nothing]

[X] Regular expression

Replace All
bbri
Posts: 2
Joined: Mon Jan 09, 2012 8:57 pm

Thanks!

Post by bbri »

Worked perfect. Thank you!
Post Reply