It would have been good if you would have written how large your file is. For files with more than 20 MB I would have coded the script completely different. The script is written for maximum performance by doing everything in memory. But this works only for small files. This script is not written for files with several dozens MB or even GB.
UltraEdit prior v18.20.0.1017 have a problem with writing large strings from memory back to a file. It takes very long. You have not written which version of UltraEdit you have and therefore I assumed that you are using the currently latest version which is v18.20.0.1017 not having this problem. For previous versions of UE I would have written instead of
- Code: Select all
UltraEdit.activeDocument.write(asBlocks.join(sBlockSeparator));
in script
- Code: Select all
UltraEdit.selectClipboard(9);
UltraEdit.clipboardContent = asBlocks.join(sBlockSeparator);
UltraEdit.activeDocument.paste();
UltraEdit.clearClipboard();
UltraEdit.selectClipboard(0);
which is a workaround for slow speed of write command on writing large strings into a file.
Malini wrote:Can I ask another favor like, on top of removing duplicates, can you display the row number it deleted?
With the script as it was, this was not possible. The line number information was not present within memory. But I rewrote the script to add also line number information. This makes the script slower, but you get in output window which lines of original file content has been removed to build new file content with less lines. See the modified script in my previous post now containing also comments.