Converting CSV for Magellan POI File Editor in Linux/Cygwin

 

After converting a few .csv files I noticed Magellan POI File Editor doesn't support the formats other devices use very well. So I wrote a small script to convert them prior to loading them into POI Editor. Below is the script:

#!/bin/bash
# MagellanCVS.sh converts CVS files to be compatible with Magellan POI File Editor
# It will change the first two , to ; to be used as a separator and remove remaining ,
# <br> " and extra spaces are also removed

# If no arguments are given explain usage and exit
if [ $# -eq 0 ]
then
  echo "Usage: MagellanCVS.sh infile outfile"
  echo "       infile = file to be converted"
  echo "       outfile = name of file to be created"
  exit
fi

# Test to be sure infile exists
if [ -e "$1" ]
then
  infile=("$1")
else
  echo "$1 was not found"
  exit
fi

# If no outfile is given use original filename with .new appended
if [ $# -eq 1 ]
then
  outfile="$1".new
else
  outfile=("$2")
fi

#Process file
cat "$infile" | sed -e 's/,/;/1; s/,/;/1; s/,/ /Ig; s/<br>/ /g; s/"/ /g; s/\o222/\o047/g; s/   / /g; s/  / /g;' > "$outfile"
echo "Conversion is complete, please check $outfile"

Save the script and give it +x permissions. The first argument is the name of the original file and the second is your destination. The two s/,/;/ changes the first two , to ; to be used as the new separators. It then removes remaining , and <br> and any " then finally extra spaces. It should run in bash, as well as Cygwin's bash prompt if you use windows. Let me know if you have any problems, or more improvements.

poi for mag maestro

what???? i am new to this how do you install pois into a 4250. thanks

install poi into 4250

Use Magellan POI File Editor to convert the file to Magellan's format. It should be on the cd that came with your gps. Also the software will transfer it to your magellan, or ou can use a sd card to store the poi's.

You don't need the script I provided, it just makes it easier to convert some. Magellan needs every name field to be unique. The script helps some in doing that. Also many of the cvs files have several commas for each entry, including between the longitude and latitude. This script will also help in seperating those values using ; as the separator. After the script is done you have latitude; longitude; name field on each line, easily separated with the POI editor.