• 1000 files, increment each first line number by 1

    16
    0 Votes
    16 Posts
    969 Views
    nextstepN

    @Javier-Rivas I have been able to achieve my objext using notepad++ although it is quite inelegant.

    I have a folder with 1000 text files, which I duplicated. I then renamed them with a suffix 000.txt -> 999.txt

    Each file has a unique first line, with a name and number, and all I did was do a search and replace to add in an extra zero and change the _001 to _0001

    It will give me a unique first line, but will be a little more messy when combine with the other folder – but will work for what I am after.

    Thanks for your help!! Most appreciates.

    Daja

    PS I know I’ve done it before, and it’s driving me nuts that I don’t remember how or where I found it…

  • Set default character set for opening existing ANSI files

    3
    0 Votes
    3 Posts
    444 Views
    EkopalypseE

    @tommick1

    Although I also recommend switching to utf8 encoding, there is a plugin called AutoCodepage that I think may be helpful in your case.

  • Unable to configure notepad++ with python

    2
    0 Votes
    2 Posts
    504 Views
    EkopalypseE

    @Chaithra-Gururaj

    How exactly did you start the process.
    From what you posted, it looks like there is no space between python and new1.py.

  • востоновление файлов

    2
    0 Votes
    2 Posts
    255 Views
    EkopalypseE

    @minemax said in востоновление файлов:

    из-за ошибки пришлось переустанавать программу из-за чего у меня удолились все мои блакноты можно ли их как небудь вернуть

    Полагаю, вы имеете в виду информацию о сеансе.
    В зависимости от того, как была выполнена предыдущая установка, вы все равно сможете найти ее под %APPDATA%\notepad++\backup.

    I assume you mean the session information.
    Depending on how your previous installation was, you may still be able to find it under %APPDATA%\notepad++\backup.

  • Lost all text

    2
    0 Votes
    2 Posts
    155 Views
    No one has replied
  • Issue with "session.xml" in N++ v7.9 (portable)?

    11
    0 Votes
    11 Posts
    967 Views
    guy038G

    Hello, @gh-2017, @peterjones, @terry-r and All,

    @gh-2017 :

    I tried your batch file with few simplifications and it worked nice ! Thanks for sharing !

    Now, here is a more simple version of what you expect to, which uses a tiny executable file, named mtrw.exe ( Instructions in comments )

    @echo off REM -------------------------- IMPORTANT ----------------------------------- REM BEFORE executing this BATCH file : REM - DOWNLOAD the "mtr206b.zip" ARCHIVE from http://adoxa.altervista.org/minitrue/dl.php?f=bin REM - EXTRACT the "mtrw.exe" file in the LOCATION of this BATCH file REM ------------------------------------------------------------------------ REM Copy the "session.xml" file as "New.txt", WITHOUT any CONFIRMATION message copy /y session.xml New.txt > NUL REM ----------------------------------------------------------------------------------------------------------------------- REM Replace, in the "New.txt" file, the DRIVE letter and the COLON of each ABSOLUTE PATH in ALL "file..." tags with REM the CURRENT DRIVE letter and the COLON ( So, the TWO FIRST characters of the INTERNAL ENVIRONMENT variable %CD% ) REM REM (-x) Search REGEX mode by DEFAULT REM -qn QUIET mode and NO prompting REM -c- SENSIBLE to CASE REM -b- NO BACKUP file REM REM Type "mtrw" and ENTER for a QUICK summary REM Type "mtrw -?" and ENTER to open the HELP file REM Type "mtrw -?:Option and ENTER for HELP on a specific OPTION REM ----------------------------------------------------------------------------------------------------------------------- mtrw.exe -qn -c- -b- New.txt [A-Z]: = %CD:~0,2% REM STARTS Notepad++ and opens ALL the files contained in "New.txt", ONLY ! notepad++ -nosession -openSession New.txt

    Best Regards,

    guy038

  • Manipulations on many files

    22
    0 Votes
    22 Posts
    5k Views
    Rafal Jonca 0R

    @Alan-Kilborn said in Manipulations on many files:

    “XY problem”

    “XY problem” ? I made it and in this way you doubted. Any questions more ?

  • Odia text not rendered properly in NPP

    4
    0 Votes
    4 Posts
    586 Views
    Ajit NayakA

    Hello, @ekopalypse and @guy038
    Thank you very much for the quick response.
    The Solution provided by @guy038 completely solves the problem and now I can write anything in my language.
    So nice of you @guy038 to provide the solution with other research outputs that will further help us for using it effectively.
    with regards
    Ajit

  • Search in files

    8
    0 Votes
    8 Posts
    377 Views
    Alan KilbornA

    Searching the disk content of an open file is problematic…because, well, how does N++ do this type of searching?
    It opens the file into a tab that isn’t shown to the user, for each file searched. Since it can’t easily open two tabs for the same file (hmmm, cloned view does it, though…?), this type of thing isn’t allowed.

  • 0 Votes
    3 Posts
    539 Views
    guy038G

    Hello @robin-cruise and All,

    Why not this S/R :

    SEARCH (?-s)^\h*<div class="fb-comments" data-href=".+

    REPLACE <!-- Facebook Comments $0 -->

    Notes :

    This regex would search all contents of any line, beginning with the string <div class="fb-comments" data-href=, possibly predeced with any leading horizontal blank chars, and places this line in comments, with the syntax <!-- Facebook Comments ............... -->

    Not a very difficult regex : you could have found out this one, by yourself ;-))

    Best Regards,

    guy038

  • Examining a character?

    12
    0 Votes
    12 Posts
    19k Views
    guy038G

    Hi, @dave-joseph, @peterjones, @alan-kilborn and All,

    Peter, I confirm your test. In an UTF-8 file, without encoding problems, the option Encoding > Convert to ANSI correctly changes the two UTF-8 bytes of each smart quote, into a one ANSI byte

    Concerning the second point, I understand : seemingly it’s always better to see the individual bytes of a file with an external hex editor !

    Cheers,

    guy038

  • Extracting some elements from the string

    3
    0 Votes
    3 Posts
    196 Views
    Rafal Jonca 0R

    Works beautifully. Thank you :)

  • [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I)

    30
    0 Votes
    30 Posts
    4k Views
    dinkumoilD

    @Alan-Kilborn

    Yes, I discovered that already in the past. Increasing inter-line spacing is also possible with other styles, for example the Brace highlight style.

  • NPP will open file with one extension, but not another for same content

    5
    0 Votes
    5 Posts
    798 Views
    PeterJonesP

    @Paul-Hutson ,

    Yes, if you have either of those preference blanks set, then files of that type will always be opened as a session or workspace config XML, and Notepad++ won’t ever let you read/edit the raw data inside.

    See for reference Footnote 1 in “Sessions, Workspaces, and Projects” from npp-user-manual.org

  • 0 Votes
    15 Posts
    800 Views
    Alan KilbornA

    @Robin-Cruise said in replace / move numbers from one row to another with regular expression (in parentheses):

    by the way, on replace, what does it mean ?1(\3#)\2(\3#) (step by step, please) ?

    It’s fairly “easy”: :-)

    ?1 controls the rest of it: If capture group #1 was NOT matched, the replacement is “nothing” (aka deletion)

    If capture group #1 WAS matched, then the replacement consists of:

    opening parens: ( what was matched with capture group #3 a literal # closing parens: ) what was matched with capture group #2 opening parens: ( what was matched with capture group #3 a literal # closing parens: )
  • Systematic addition of text and the current file name into 320 files

    3
    0 Votes
    3 Posts
    280 Views
    mkupperM

    @Aaron-Mills - I use Windows command prompt’s built in scripting and GNU sed to do what you need. For example, start up command prompt and cd to the top directory of where your HTML files are. Run this command for /r %i in (*.htm) do @echo %~ni You will see a list with the file names for each *.htm files from the current directory on down.

    Let’s say you want to add a <title>file-name</title> element at the top of the <head> section of each file.

    for /r %i in (*.htm) do sed -i -r -e "s~(<head>)~\1\n<title>%~ni</title>~" "%i" del sed??????

    You asked for the file name. If you also want the file extension included in the title then use %~nxi
    If you want or need to use the full file path then it gets painful. While the full path is available using %~fi you can’t use it as-is in a regular expression as the path contains \ backslash characters. There are workarounds but that’s getting out of the scope of how to do this given my suggestion does not use Notepad++.

    The second line with del sed?????? removes the temporary files created by sed’s -i command line option which I used to do in-place editing of all the HTML files.

  • Excluding all of a Line when using Add / Replace

    8
    0 Votes
    8 Posts
    2k Views
    Steven WarrensS

    A BIG thanks to all for your help. It looks like I will be using several different combinations of suggestions offered here. Wish me luck and thanks again!!

  • Trouble with Windows XP

    7
    0 Votes
    7 Posts
    957 Views
    Juan Manuel Carrillo CamposJ

    Well, some time later I have reviewed and the versa 350 has pentium M processor, my very old device is also a Pentium III and got the same errors that ARI1972’s. I assume the VM are installed in a more recent hardware then they support the machine instructions that fail in P-III hardware. I use the version of NP++ that gives me the two exception errors but it works anyway. I’ll continue using my p-III until the device gets a “no-more” condition.

  • Search in folder (encoding)

    41
    0 Votes
    41 Posts
    4k Views
    EkopalypseE

    @gstavi said in Search in folder (encoding):

    If you will ever open regedit on a Hebrew Windows and see all the English content aligned right-to-left you would lose all respect to Microsoft.

    Maybe I should give it a try to finally be persuaded to switch to Linux :-D

  • Making fonts larger so old men can read

    4
    0 Votes
    4 Posts
    719 Views
    Alan KilbornA

    @Michael-DeLigny

    To be a bit more specific, these might be the settings you’ll want to experiment with:

    5dd3553b-ae2f-46a6-804c-3fec7b08f3f3-image.png

    Also: You can temporarily change the size of text by pointing your mouse at the window, holding the Ctrl key, and scrolling the mouse wheel in either direction.

    I don’t want to change the native format of the text I’m viewing

    This shows you have a basic misunderstanding about what text editing is and what a text editor does. @zanud clarifies nicely with:

    (None) of file types supported by Notepad++ have font-related properties. All font names, sizes, styles used by Notepad++ are for viewing only, and they are never stored in the files.