i am currently hitting with the insufficient memory issue when I run this command on my system.
With 12GB of memory and a 5GB file, this should not be happening.
When you hit an error, if you post the error message you receive -- cut&paste rather than paraphrased -- you may get a quick solution to your problem.
.By the way, can this command be used in script and run?
What kind of script?
or is it perl one liners?
It is a bog standard windows command.
It can be invoked: from the command line; from a batch script; from a perl script; or in any other way a system command can be invoked.
Also how is it different from external sort that I have used and now what you have mentioned?
The perl script you showed calls back into perl for every comparison; and (unnecessarially) re-splits two lines for every comparison.
Assuming your example snippet lines are representative of the whole file; and assuming average number of N*log2(N) comparisons are required to sort your file, that means you are calling back into Perl 1.5 billion times and re-spliting lines 3 billion times.
It is unsurprising that a dedicated sort utility that doesn't need to do either of those things will run more quickly.
Please clarify
You are sorting your data by the 1 field that appears at the beginning of each record, therefore there is no need to split the records in order to sort them correctly.
In reply to Re^3: external sort performance improved?
by BrowserUk
in thread external sort performance improved?
by rkshyam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |