FYI, I build a Perl script to prepare data for input into QuikGrid. I was processing a 70 meg file on an old single-core 32 bit Athlon 2800+ in thirty seconds with it. #!/usr/bin/perl use strict; for (<>) { my ($lat, $lon, $alt) = split(/;/,$_); ($lon, $lat) = fix_data($lon, $lat) if ($lon < -180 or $lon > 180 or $lat < -90 or $lat > 90); print '$lon $lat $alt'; } sub fix_data { my ($lon, $lat) = @_; $lon += 360 while ($lon < -180); $lon -= 360 while ($lon > 180); $lat += 180 while ($lat < -90); $lat -= 180 while ($lat > 90); return ($lon, $lat); } To use, cat your files and pipe it in on Standard I/O, then pipe the results to file. I could probably get some minor performance gain if I tweaked a few things, but it\'s already stupidly fast. I just processed a 119M file in fifty seconds.