How to delete lines with missing characters in certain positions
-
I’m trying to delete lines that have missing characters in certain positions of a line. So if line position 18 is blank, I’d like to delete the entire line.
-
@Bpy72876175 What about the following?
(warning - completely untested)
-
-
It worked!!! Thank you so much. More of a business guy here not a coder, but I used that and just changed the character position as needed to Bookmark those lines…and then delete. Thank you again
-
@Bpy72876175 said in How to delete lines with missing characters in certain positions:
I used that and just changed the character position as needed to Bookmark those lines…and then delete.
Good job generalizing and figuring out how to adapt someone’s solution to your needs.
If you want to get rid of the blank lines as well, just change @Bart-Terryn’s regex to
^.{17}\s.*\R?
, so it will include the newline sequence when it deletes the data on that line. -
@Bpy72876175 said in How to delete lines with missing characters in certain positions:
More of a business guy here not a coder, but I used that and just changed the character position as needed to Bookmark those lines
But you seem to already know your way around Notepad++ pretty well, if you were able to “bookmark” matching lines and delete them.
For others that might not be so savvy, here’s how it could have been done:
Use the Mark All command on the Mark tab of the Find window to get lines with a “blank” in the appropriate column to appear in red and have a “blue ball” symbol to their left – the blue ball is the bookmarking symbol:
Right click on a bookmarking symbol (actually anywhere in the column of the blue balls is fine) and a menu will appear, from which you may then choose Remove Bookmarked Lines:
After executing that the bookmarked lines (and the blue balls) are gone.