Text manipulations using UltraEdit

Posted on 2009-12-18
Last Modified: 2012-05-08
Please suppose I have a text file with size 2 gigabytes.
In this text file I can see many duplicated rows.
I need to remove rows NOT containing the number 2713, and then to remove duplicated rows.
The duplicates can be removed with UltraEdit, but how can I remove, using UltraEdit, the rows NOT containing the number 2713?
And how can I proceed, if I want to remove max 10000 rows at a time, NOT containing the number 2713?
Thank you in advance for your kind cooperation.
Question by:hc2342uhxx3vw36x96hq
    LVL 74

    Accepted Solution

    You can open the Find dialog (Ctrl-F). Enter "2713" as your search criteria. Select the box "List Lines Containing String", then click "Next." You can review the list in the new dialog before proceeding. If the list looks correct, then click "Bookmark All" followed by "Close." Next, go to Edit->Delete->Delete All Bookmarked Lines.
    LVL 74

    Assisted Solution

    by:käµfm³d 👽
    Wait. That is incorrect.
    LVL 74

    Assisted Solution

    by:käµfm³d 👽
    I don't see an easy way in UE to do what you are looking for. If you expect the number of occurences of "2713" to be small, you can do a search on "." using PERL style RegEx. This should match any line that has text (no blank lines). Then you can switch to a regular search (no RegEx) for "2713" and step through each result and remove its bookmark (using Ctrl-F2). Once you are done, do the "Delete All Bookmarked Lines" I mentioned above.

    An alternative would be to use TextPad ( There is a free trial (which never seems to expire!). In Textpad, you could use the method that I was attempting to do above.

    Hit F5 to bring up the search window. Enter "2713" as your search criteria and "Mark All". Then close the search windows and go to Search->Invert All Bookmarks. Then you could do Edit->Delete->Bookmarked Lines.

    This method would work in UE if you can find some way of inverting the bookmarks. I did not see anything.
    LVL 1

    Author Closing Comment

    Ok, thanks ;-)

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    Read about achieving the basic levels of HRIS security in the workplace.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now