Thank you both for your input.
Marsd, regarding your solution, I have a small concern. How would destroy(array) work? I've had some problems with the 'delete [array]' command in gawk (or the original awk method where you delete the array's elements one by one). They do not seem to deallocate the...
Thanks anyway. From what Greg posted and what I've read, I believe the difference in my join and yours can be related to the global env LC_COLLATE. However I wasn't able to change it correctly. I ended up solving my problem by padding the join field with leading zeros, so it would have always...
Thanks for the info bigoldbulldog. I've also managed to redurce the run time by removing some "hidden" loops that were out of control. I've also tried gawk. For my script the improvement in performance was a whopping 260%!! I've also tried nawk, but the performance was very similar to...
Good thinking, but it didn't work either. Here is the sorted inputs (just the join field):
100000
100001
100002
100003
100004
100005
100006
100007
100008
100009
10000
100010
And the output:
100000
100001
100002
100003
100004
100005
100006
100007
100008
100009
100010
The "10000" is...
I was trying to join the two files by the first field ( I believe that's join's default option). The output should look like:
[key field][rest of file 1][rest of file 2]
For istance, the first line would be:
1|304500001||1|0|304500001|(...)|304500001|3|105|29563|(...)
Thanks,
Romeu
CaKiwi,
Yes, after re-reading my own text I have to agree that your answer is the only one that makes sense. My fault, sorry. I forgot to explain properly that the more recent script is taking increasingly more time running, as I add more and more validations to each line, in a more or less...
In my earlier scripts, I could add a bunch of loops and arrays without a significant impact on run time. In other words, the most time consuming operation was to scan the file, and I could add more and more validations to each line with only a minor impact on performance (one script has more...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.