Community
    • Login

    How to find posts in my HUGE Master file..

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 19 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Allinmyhead
      last edited by

      …I scraped for only my posts from the past 4 years. I ended up with a file that has about 600 pages. Notepad++ is awesome with opening the file easily, couple of seconds. I can search for words, or my Username on the forum to weed out any “quotes” or from others.

      What I need to do, to trim things down, is find just posts with my username on them. I don’t know how to set it up to find whole posts though. Not sure Notepad ++ can actually do this, and couldn’t find documentation.

      Any help would be appreciated, and I will need the Community for more things I’m sure I might need to ask help for, so I am glad you have a forum:)

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones @Allinmyhead
        last edited by PeterJones

        @Allinmyhead ,

        Notepad++ has no notion of “post”. It just sees a big blob of text, and tries to apply the search string you give it. If you search for just your username, that’s the only piece that will match. If you use a more complicated regular expression (“regex”), you can define a fancy search that will match more.

        If you gave more details about what a “post” is formatted in text, we could help you come up with the right regex. For example, if the post is username: blah blah blah [newline][newline], then something like ^username: .*?\R\R would find everything from username: to the two newlines in a row.

        But Notepad++ is not just going to “hide” everything else, and allow you to look at just that. As you do each Find Next, it will just highlight the entire match. It might be possible, if you gave us examples of what this file would look like, to be able to strip out “posts” that aren’t yours, instead. (Similar to the above, but matching anything but your username at the start of the post). But until you give us example data that matches your formatting, and show which posts you’d like to keep and which to delete, there is no way we could randomly come up with the right regex to help you.

        Click the </> button in your reply. Put some data in the code-box that creates. Make sure the data matches your actual data, and is formatted exactly the same. Indicate which “posts” you’d like to keep vs delete. Make sure you give us a description of how you, as a human, would recognize where one post starts and ends.


        Update: it might actually be easier to use the Mark dialog to mark all the username posts, rather than the find/replace to delete the non-username posts. That would allow “copy marked lines”, and then the username-only ones could be pasted in a new file, rather than deleting the non-username posts from the original. But it depends on the shape of the data, and whether you’d prefer to just delete from your old file or create a new one…

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors