## Summert Txt to VS1 converter

Talk about anything that doesn't fit anywhere else
pferland
Contributor
Posts: 406
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

### Summert Txt to VS1 converter

Just finished up the Vistumbler Summery Text to VS1 converter ->http://vistumbler.svn.sourceforge.net/v ... ifidb/CLI/. All you need to run this script on Windows is php.exe and php5ts.dll. While I was building the script I was running it agains this file ->http://forum.techidiots.net/forum/viewt ... ?f=16&t=57, on my Athlon64 X2 5400 and was converting it in less then 3min. Give it a try, let me know what you think and if there are any problems that you come accross.
Attachments
txt2vs1.zip

pferland
Contributor
Posts: 406
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

### Re: Summert Txt to VS1 converter

Here is the Read Me.txt file for the converter.
This is a converter for the Vistumbler Summery Text file to the VS1 file.

I wrote this script in windows, but it can run on any OS that you have PHP on.
To run this scrip stand-alone all you need to do is download the PHP package from http://us2.php.net/get/php-5.2.6-Win32. ... m/a/mirror

Browse to Y:\[Path to PHP]\bin\
- Where Y is the drive you have PHP installed in and [Path to PHP] is where PHP is stored on the drive.
Type "php X:\[Path to converter]\convert_vs1.php"
- Where X is the drive you have the converter stored and [Path to converter] is the folder that the converter lives in.

The convert_vs1.php file searches the "text\" folder for vistumbler Text Summery files to convert
It is self aware of where it is living so there is no need to configure it, unless you want it to
look in another Directory.

To do so just comment out:

/*
$dirs=$_SERVER['PHP_SELF'];
$dir_exp = explode("\\",$dirs);
$dir_c= count($dir_exp);
foreach($dir_exp as$d)
{
if($d == "convert_vs1.php") { continue; }$dir .= $d."\\"; }$dir.="text\\";
*/

and uncomment:

// $dir = "Place the DIR that you want searched Here after commenting out the above portion" ; =================================================================== To change where the output of the VS1 file goes do the same for functions.php comment out: /*$dir_exp = explode("\\", $source);$dir_c = count($dir_exp);$script = $dir_exp[$dir_c-1];
if ($debug ==1 ) { echo$script."\n";
}
foreach($dir_exp as$d)
{
if($d ==$script)
{
continue;
}
$dir .=$d."\\";
}
$dir.="vs1\\"; */ and uncomment: /*$dir = " Place the DIR that you want the VS1 files to go, after commenting out the above portion " ;
*/

===================================================================

The convert_vs1() function:
This is the function that does all the work

\$source : the dir and file that you are converting

"file" : output the conversion to a VS1 file, [Supports "file", "File", or "FILE"] (I am working on having a database output too, via MySQL)

Example CLI output:
--------------------------------------------

=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-Vistumbler Summery Text to VS1 converter=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-
Directory: c:\users\pferland\Desktop\vistumbler\wifidb\CLI\text\

Files to Convert:
0 10602.txt

################=== Start conversion of c:\users\pferland\Desktop\vistumbler\wifidb\CLI\text\10602.txt ===################
1% - 2% - 3% -
Line: 365 - Wrong data type, dropping row
4% - 5% - 6% - 7% - 8% - 9% - 10% - 11% - 12% - 13% - 14% - 15% -
16% - 17% - 18% - 19% - 20% - 21% - 22% - 23% - 24% - 25% - 26% -
27% - 28% - 29% - 30% - 31% - 32% - 33% - 34% - 35% - 36% - 37% -
38% - 39% - 40% - 41% - 42% - 43% - 44% - 45% - 46% - 47% - 48% -
49% - 50% - 51% - 52% - 53% - 54% - 55% - 56% - 57% - 58% - 59% -
60% - 61% - 62% - 63% - 64% - 65% - 66% - 67% - 68% - 69% - 70% -
71% - 72% - 73% - 74% - 75% - 76% - 77% - 78% - 79% - 80% - 81% -
Line: 8660 - Wrong data type, dropping row
82% - 83% - 84% - 85% - 86% - 87% - 88% - 89% - 90% - 91% - 92% -
93% - 94% - 95% - 96% - 97% - 98% - 99% - 100% -

Total Number of Access Points : 10597
Total Number of GPS Points : 8916

-------
DONE!
Start Time : 11:48:16
Stop Time : 11:51:38
-------
The best acceleration you can get on a Mac is 9.8ms^2

pferland
Contributor
Posts: 406
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

### Re: Summert Txt to VS1 converter

Well,
while I was on my two weeks off from work, I went back to the Vistumbler Txt to VS1 Converter and found and fixed a few bugs. The GPS wasn't being converted properly, and there were way more GPS points being added then there needed to be (duplicates). I also was messing around with a PHP wrapper for the script, and make it into a pseudo-EXE so that there is no need to have PHP installed on your local system to use this.
please let me know how you like it, and if there are any issues with it, or anything that you would like added.

-Phil
Attachments
txt2vs1.zip

pferland
Contributor
Posts: 406
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

### Re: Summert Txt to VS1 converter

Here is v1.1 of the txt2vs1 converter. I have fixed most if not all of the GPS issues and conversion problems. the output GPS format is DDMM.mmmm(and support for DDDMM.mmmm for GEOCORDS with a deg of 100 or more)
txt2vs1_11.zip
Version 1.1