Well, turns out a road trip was planned that I didn’t know about until about 5 hours ago [8 PM], and I’m annoyed I won’t beable to relax for the long weekend [ARG]. I’ve been stressed out over homework and classwork and just want a few days to relax and catch up on work. Well, dad and mom had different plans. Ussually I don’t mind or complain, but I’ve really been out of it lately and really just wanna stay at home n stuff.
But anyway, I’ll go to collect some more networks for WiGLE and stuff. Speaking of which, I figured you can import data into Microsoft Street and Trips! Well alright.. lets just export a sample database here.. alright.. import text file seperated by tabs.. hm.. cool.. set first column latitude, second longitude.. third name.. rest exclude.. alright and import..
Processing 2343 entries….. 0 matches.
Wha? Uhm… switch latitude and longitude…
Processing 2343 entries….. 0 matches.
Ok.. check.. double check.. yeah it’s getting the info in right..
Lets try a excell file… Nope.. same thing.. Hm.. maybe it requires the letter [N, E, S, W in the latitude/longitude info] on the other side of the number? Yeah.. Oh! That worked. Alright.. but uhh.. why does it place it nowhere near where I scanned? Hm.
Well I guess it’s a small problem.. lets make a script to do all that automaticly.
OH freaking wait.. it cuts off latitude and longitude entries to 6 characters in text databases. Well ain’t that fun. Hm.. that isn’t gonna work. Too bad this script is gonna go to waste.
Allwell.
//Convert Network Stumbler files to a text file Microsoft Street and Trips can read easily
/*
...not - You see, Microsoft Street and Trips have a nice data import function. Works great... Except when you try and import a text file. I'm not willing to reverse engineer a excell file to get this stupid thing to work right, so meh. This script works fine... as long as you don't care about all your locations appearing in a totally different hemisphere. The data import function generally cuts off the location entry so it's about 6 characters long. Well this messes up accuracy majorly as well as cuts off the compass letter [which MSS&T will only recongize at the end, so meh]. So instead of your locations appearing in north america, they appear somewhere in africa. Using negative numbers work, but I don't want to bother. I need greater accuracy for mapping wifi networks anyway.
*/
echo "Opening\n";
$file = file_get_contents($_SERVER['argv'][1]);
echo "Splitting\n";
$file = explode("\n",$file);
echo "Processing...\n";
$time = time();
$out = (strrpos($_SERVER['argv'][1],".") !== false ? substr($_SERVER['argv'][1],0,strrpos($_SERVER['argv'][1],".")) : $_SERVER['argv'][1]) . "-out.txt";
$out = fopen($out,"w");
fwrite($out,"Latitude\tLongitude\tName\n");
foreach ($file as $id => $entry) {
if (time() != $time) {
echo round($id / count($file)) . “%\n”;
$time = time();
}
$entry = explode(”\t”,$entry);
if (strpos($entry[0],”#”) === 0) continue; //Comment checker
$entry[0] = substr($entry[0],2) . ” ” . substr($entry[0],0,1);
$entry[1] = substr($entry[1],2) . ” ” . substr($entry[1],0,1);
fwrite($out,”{$entry[0]}\t{$entry[1]}\t{$entry[2]}\n”);
}
echo “Done.”;
?>
Meh.. to bed.