Combining content of files?



  • I have about 200 text files. Is there any way to combine lines in each file to form a single file? Because if I copy this file and then paste it to the other file, it will take a long time. Hope there is a solution for this case.



  • @Sarah-Duong ,

    There are plenty of ways. Notepad++ just doesn’t happen to have implemented one of those by default. You could do it in a scripting language inside Notepad++, but that seems overkill.

    From the windows cmd.exe command line,

    for %f in (*.txt) do @(type %f >> outfile)
    

    In a batch file, change % to %%.

    Now outfile contains the merge of all those files.



  • @PeterJones Thanks for answering. Sorry for the late reply.
    Let me ask how to find the lines that contain the characters “Look” and “Say”. These 2 words are located anywhere in each line.
    One more question: Which characters should I use to search for a line of 5 or more characters? For a long time I used " (?: [a-zA-Z0-9.!? * ":; + - &% $ # @ × () ~` | ÷ / |] {5,}) " covers everything but this is still not enough.Is there any other way, simple but comprehensive all the characters? I pray, and hope you understand what I said.



  • Hello, @sarah-duong and All,

    • Regarding your first question, use, either :

      • (?-is)^.*(Look.+Say|Say.+Look).*     OR     (?i-s)^.*(Look.+Say|Say.+Look).* for a insensitive to case search

    • Regarding your second question, why not this simple syntax, with the dot regex : symbol ( . ) which represents any single standard character ( NOT line-break chars )

      • (?-s)^(.{5,})     Note that all line contents are stored as group 1 which may be used, in replacement, with one of the syntaxes : \1, $1 or ${1}

    Best Regards,

    guy038



  • @guy038 You seem to be misunderstanding me. Probably due to my incomplete question. The format of each line is as follows: For example: “(a-zA-Z0-9). Look | (a-z0-9) .Say” This example is still missing. I meant to find this format. “Look” is always to the left of the "| and vice versa “Say” on the right. Do you understand?
    In question 2, I want to find the format Emai:Pass , (Pass is any character, 5 or more characters). I tried applying: ^. +: (? - s) ^ (. {5,}), but … you probably know the result. 🥴 Sorry



  • It was really difficult when my English level was too short. Hopefully, people will imagine how rich to understand how Google is translating. Unfortunately



  • Hello, @Sarah-Duong

    excuse me, but your new posts are even more confusing.
    My mother tongue is not English either and I often use an online translator to express myself here.
    What I noticed is that the better and more precise I express myself in my mother tongue, the better the translator can translate this reasonably.
    And to the question itself, if example data can be provided, where to say exactly what you have and what you expect, then these are almost even more helpful than the explanations.



  • Hi, @sarah-duong, @ekopalypse and All,

    Ah… OK ! So, regarding your second question, I would say :

    SEARCH ^.+:.{5,}

    Note that I did not place any group (....) in my regexes because we don’t know what you really want to do :

    • To search for some text

    • To mark some text

    • To bookmark some text

    • To replace some text with nothing or other text

    and which part of current line are you looking at :

    • The part before the colon :

    • The part after the colon :

    • All the line contents without its like-break characters

    • All the line contents with its like-break chars

    So, in summary, be as specific as possible about your needs. Once we have the different elements, it will be easy to to fine-tune the regex ;-))


    Now, about your first question, it’s even worse :-(

    First, I would say that the regex, given in my first post, does find your line (a-zA-Z0-9). Look | (a-z0-9) .Say ?!

    Now you said, previously :

    These 2 words are located anywhere in each line.

    But in your last post you say :

    “Look” is always to the left of the "| and vice versa “Say” on the right.

    There is a contradiction !


    A few questions in a jumble:

    • Do you mean that you’re looking for literal strings (a-zA-Z0-9). and (a-z0-9) . ?

    • A dot symbol . is separated from the word Look by a space char but the second dot is close to the word Say. Is it normal ?

    • Do you search for the exact words Look and Say or are the forms LOOK, say, LooK or sAy correct, too ?

    BR

    guy038



  • @Ekopalypse sorry. I using phone. Can you do that on your phone?



  • @Sarah-Duong

    There’s no need to apologise, you’ve done nothing wrong.
    I would be more than surprised if there were no translators
    in the respective app stores and after all, every mobile phone
    has a browser, so you can definitely access an online translator, can’t you?



  • @Ekopalypse
    what? that’s translated text? wow, i never would have guessed that.



  • Hello, @jakima,
    yes, online translators get better and better.
    I use one called DeepL.
    DeepL does not offer as many languages as Google yet, but the results are better as far as I can tell.

    e68c93b2-53d0-49d6-b7b5-d653d401e761-image.png



  • @Ekopalypse and that is what google translated. I just did the copy and post work up here. I also do not understand why after using google translate and copy posted here, then I went back to read and found that I wrote so much wrong, and could not translate.



  • @Ekopalypse ok, thanks for share it. I will try using it. Hope it will bring better results. Ah let me ask, if I post a topic in the local language here, can you understand it through the automatic translation program? However, I noticed one thing: for example, I wrote a text: Myname12;$& then when translated into English, the text will be completely different. It will display as Myname12; $ &. It has extra spacing between special characters. My local language has accents, which leads to some character encoding



  • @Ekopalypse It seems that your site Deepl, it has surrendered to my language. Vietnamese



  • @Sarah-Duong

    Yes, as I said, DeepL does not support as many languages as Google, Microsoft etc… yet.
    In my opinion, the secret of a good translation is to be as accurate as possible in your native language.
    Furthermore, I proceed in such a way that I check whether the translated text can be meaningfully retranslated.
    If so, then it will be understandable, at least I hope so.
    Example data should NEVER be translated, otherwise exactly what you have described can happen.


Log in to reply