regex newbie

General questions about using TextPad

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

Post Reply
Justif
Posts: 3
Joined: Wed Jun 06, 2012 10:14 am

regex newbie

Post by Justif »

I am a new regex user and i have been trying to figure out how to delete multiple lines from a file. can anyone help please?
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

You're going to have to give more information than that if you want someone to help. Please give us a sample of the file and a sample of the lines you want to delete. Enclose the sample text in [ code][/code] tags in your reply to preserve formatting.

For general information about regular expressions, see this post.
Justif
Posts: 3
Joined: Wed Jun 06, 2012 10:14 am

Post by Justif »

i replaced all the lines i wanted to delete with (nothing) so that it now looks like
Claims .rdl(458): <Value>=Fields!Description.Value</Value>
Claims1 .rdl(640): <Value>=Parameters!userid.Value</Value>(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)(nothing)
claims4 .rdl(743): <Value>=First(Fields!CompanyDESC.Value)</Value>

so now i need to use regex to search for every line that says nothing and delete them so that it now looks like
Claims .rdl(458): <Value>=Fields!Description.Value</Value>
Claims1 .rdl(640): <Value>=Parameters!userid.Value</Value>
claims4 .rdl(743): <Value>=First(Fields!CompanyDESC.Value)</Value>


I hope that helps...thanks
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Do you just want to remove every occurrence of (nothing)? That is what your example indicates, although it is not quite what your description suggests.

If so, you don't need regular expressions:
Find what: (nothing)
Replace with: [nothing]

[ ] Regular expression [i.e., not selected]

Replace All
Justif
Posts: 3
Joined: Wed Jun 06, 2012 10:14 am

Post by Justif »

thanks.
Post Reply