Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I have a lot of files, with empty single line at the beginning of files. How can I remove it?
Thank you in advance.
It's quite easy to get rid of initial blank lines, at the beginning of a file, using PCRE regular expressions of Notpad++ !
Open the Search/Replacement dialog, with the CTRL + H shortcut
Set the Regular expression button radio
In the SEARCH field, type in : \A\R+
Leave the REPLACEMENT field empty
Click on the Replace All buttton
Et voilà !
\A is an assertion which MUST be verified by the regex and represents the VERY start of the file. It must be written in UPPERCASE, because the regex \a stands for the BEL character (\x07)
\R+ represents a NON NULL list of ANY consecutive EOL. Note that an UNIQ \R stands for \r\n, in a Windows file, for \n, in an Unix file or for \r, in an old Mac file.
SEARCH : \A(\h*\R)+
\h* represents the longest string, possibly null, of any of the 3 horizontal blank characters ( \x20 = SPACE, \x09 = TABULATION and \xA0 = NO-BREAK SPACE ), before the EOL.
The FIRST link concerns the syntax of regular expressions in SEARCH
The SECOND link concerns the syntax of regular expressions in REPLACEMENT
Great! ( :
Thanks a lot THEVENOT Guy.