• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2042
  • 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.
0
hc2342uhxx3vw36x96hq
Asked:
hc2342uhxx3vw36x96hq
  • 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.
0
 
käµfm³d 👽Commented:
Wait. That is incorrect.
0
 
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.
0
 
hc2342uhxx3vw36x96hqAuthor Commented:
Ok, thanks ;-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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