Page 1 of 1
regex newbie
Posted: Wed Jun 06, 2012 10:21 am
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?
Posted: Wed Jun 06, 2012 10:40 am
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.
Posted: Wed Jun 06, 2012 10:53 am
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
Posted: Wed Jun 06, 2012 11:12 am
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
Posted: Wed Jun 06, 2012 11:21 am
by Justif
thanks.