View Single Post
Old 09-09-2004   #1 (permalink)
motec
Registered Member
 
Join Date: Aug 2004
Posts: 20
NetStumbler to Streets & Trips

I took v1all.pl, originally written by guruchill and furher modified by Thorn and made a few changes. Mainly, it now deletes any files that contain no records, instead of leaving files with just the header information. I also added the ability to change some defaults using command line switches and the ability to prefix the outputfilenames with a string supplied at the command line. I did this mainly as an exercise in learning perl so I'm sure the way I did things can be improved on and I'd be interested in seeing how.

Here are some comments from the file itself:

# Name: ns2st.pl (NetStumbler to Streets and Trips)
# Version 1.0 Sept 9, 2004
#
# Description:
# This script accepts as input a 'summary' text file exported
# from Netstumber 0.4 and creates up to four files (wep_ap.txt,
# nowep_ap.txt, wep_ah.txt and nowep_ah.txt) formatted for input
# into Microsoft Streets and Trips
#
# Original credit for the core of this script belongs to guruchill
# with additional modifications by Thorn.
#
# As an exercise in learning Perl the file was further modificated
# by MoTec. Empty files are deleted and the following command line
# switches were added:
#
# --verbose (or -v) : display information while processing
# --debug (or -d) : output debug information to debug.txt
# --inputfilename (or -i) : specify inputfile, defaults to fullsum.txt
# --outputfileprefix (or -o) ; specify a prefix added to the filenames listed above
#
# Example of usage:
#
# $> ns2st -i summary.txt -o 20040909
#
# This will use summary.txt (instead of fullsum.txt) as input and create
# files named as follows: 20040909_wep_ap.txt, 20040909_nowep_ap.txt
# 20040909_wep_ah.txt and 20040909_nowep_ah.txt. Files with no entries
# will be deleted, as always.
#
# **NOTICE**
# This script now requires Getopt::Long from CPAN. This can be added
# By typing this at a command prompt (ommit the leading #):
# perl -MCPAN -e 'install Getopt::Long'
#
################################################## ########################
Hopefully this is usefull for someone.

-MoTec
Attached Files
File Type: txt ns2st.pl.txt (5.9 KB, 1358 views)
motec is offline   Reply With Quote