Page 1 of 1

Deleting a line and joining the next

Posted: Thu Jul 02, 2009 10:29 am
by ngdoherty
Hi

I have a line of text which I can delete - but I need to join the lines above and below


<?php endif;
echo "Delete This Line";
?>

So it end up with

<?php endif;?>

How do I do that?

Note the line above may NOT always be <?php endif;
But the last line will always be ?>

Hope I'm making sense.

Thanks

Posted: Thu Jul 02, 2009 10:49 am
by ben_josephs
How do you identify the lines to delete?

By the text of the line itself?
Find what: \necho "Delete This Line";\n
Replace with: [nothing]

[X] Regular expression
Or by the text of the line that follows?
Find what: \n.*\n\?>
Replace with: ?>

[X] Regular expression
Or by both?
Find what: \necho "Delete This Line";\n\?>
Replace with: ?>

[X] Regular expression
Note that these don't use regular expressions, but TextPad only interprets \n as a newline (in both the search and replacement expressions) if you select Regular expression.