At 07:23 -0700 5/29/11, [email protected] wrote: >Hi all I would like to find lines like below and replace them with >blank lines, I have read the GREP tutorial but had no succes PLEASE >help > ><p class="text">08-06-2011 15:49:25</p> ><p class="text">08-06-2011 15:54:45</p> ><p class="text">08-06-2011 15:56:13</p> > >Also is it possible to script so I can replace different lines in the >same workflow?? >
It sorta depends on what else is in your file. With grep turned on the idea is that ".*", without quotes" will match anything. ".+" will match one or more of anything. <p class="text">08-06-2011 .+</p> would be a search string that would look for an identical date but would allow anything for the time part. <p class="text">08-06-2011 [\d:]+</p> Would match times that have digits, \d, and colons in them. How fancy you need to be is determined by the lines you want to keep. Doing a search and find next a few times before you replace all is a good way to check for accidental finds of something you want.. To replace just the text leaving a blank line your replacement string would be "" - an empty string. If you want the whole line to go you could add \r to the end of the search string so you would be replacing the line end with nothing. Note that you usually have to escape things in your search string that are special symbols used by grep. That would include a period "." but you don't seem to have anything like that in the line as you present it. As for different lines, that would be a script or a text factory. Personally I find plain old perl scripts are easier but that's just me. -- --> A fair tax is one that you pay but I don't <-- -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at <http://groups.google.com/group/bbedit?hl=en> If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
