• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2110
  • Last Modified:

Text manipulations using UltraEdit

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.
  • 3
3 Solutions
käµfm³d 👽Commented:
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.
käµfm³d 👽Commented:
Wait. That is incorrect.
käµfm³d 👽Commented:
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 (www.textpad.com). 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.
hc2342uhxx3vw36x96hqAuthor Commented:
Ok, thanks ;-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now