OMG - I had that in initially for the long runs, when 10min waiting time was to expect for the big file. And left it in, for comparability. Missing that I'd not need it anymore, after all the time got cut down from 813392 ms to 250805 ms. I tested again (the last, fast version without the "put myCounter"):Thierry wrote:First, comment your "put myCounter" and *THIS* will speed up your loop.
6.7.10:
5000 replacements / 79 ms; 0.0158 ms/record
67648 replacements / 1088 ms; 0.016083 ms/record
8.0:
5000 replacements / 156 ms; 0.0312 ms/record
67648 replacements / 2098 ms; 0.031013 ms/record
Now isn't that fast? The (pre-cleaned) big file here is 12.848.647 Bytes, has 67.648 lines/records and in each 3 of it's 38 fields are modified. Who needs Assembler when you have LC? ;-)))
Result looks like intended. For reference, here the first record in its 3 incarnations:Thierry wrote:Second, I think there is a slight error in your date conversion (item 12).
You need to unquote and quote again the date.
Code: Select all
Original exported from MySQL:
"172";"30";"55";"1";"A product name xyz";"";"";"0000055";"6";"3,8500";"";"2014-10-02";"1";"2";"angelegt";"";"";"2014-10-05 19:14:29";"0,00";"0,00";"0,00";"0";"0";"0,00";\N;"0,00";"0,00";"0,00";"0,00";"0,00";"";"0,00";"0";"0";"0";"";"0";"0"
Pre-Cleaned (numtochar(17) changed to "#" for readability):
172#30#55#1#A product name xyz###0000055#6#3,8500##2014-10-02#1#2#angelegt###2014-10-05 19:14:29#0,00#0,00#0,00#0#0#0,00##0,00#0,00#0,00#0,00#0,00##0,00#0#0#0##0#0
Fully done ([#]changed fields[#] marked like this):
172;30;55;1;[#]A product name xyz[#];;;0000055;6;[#]3.8500[#];;[#]10/02/14[#];1;2;angelegt;;;2014-10-05 19:14:29;0,00;0,00;0,00;0;0;0,00;;0,00;0,00;0,00;0,00;0,00;;0,00;0;0;0;;0;0
Thanks, and have fun!
Appendum: Times for 6.7.10 32-bit in LUbuntu-64 LTS:
5000 replacements / 55 ms; 0.011 ms/record
67648 replacements / 739 ms; 0.010924 ms/record
Whow!