On 01/13/2021, at 16:28, Howard <[email protected] <mailto:[email protected]>> wrote: > I have several hundred lines of data. Each observation occupies two lines; > however, in a number of places (not all) a blank line exists between > observations. For example, between the first data element, Max Scherzer, and > the second one, Justin Verlander, is a blank line. (A sample is below.) > > The first two rows contain the column names. > > How can I remove all the blank lines?
Hey Howard, It looks like your blank lines are actually empty records with tab separators. Personally I'd use a text filter for this. Save this sed script to a text file. #!/usr/bin/env bash sed -E '/^[[:blank:]]*$/d' In this folder: ~/Library/Application Support/BBEdit/Text Filters/<Your Filter Name>.sh Run from BBEdit Menu Bar › Text › Apply Text Filter › Your_Filter_Name. If you're going to use it often then give it a keyboard shortcut in BBEdit's Menus & Shortcuts prefs. If you just want to use a regular expression in the Find/Replace window then use this pattern: ^\h*$\R+ Replace with nothing. -- Best Regards, Chris -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/CBDC7D82-B0BB-4B4B-ABE7-9A831089DB4E%40gmail.com.
