Importing txt/cvs into Microsoft Visio

When you are in need of a graphical overview of something and you are able to script it, chances are you are able to import this information into Microsoft Visio.

Here is an example case; You would like to see what what objects link to other objects, not in text, but graphically.

Imagine this is the data:

ONE is connected to TWO
TWO is connected to THREE
THREE is connected to ONE

Read more to create this simple graph:
An example image of a graph.

  1. Convert this information into this (Visio compatible) format:
  2. Shape,"ONE","","this shape is called ONE"
    Shape,"TWO","","this shape is called TWO"
    Shape,"THREE","","this shape is called THREE"
    Link,"","","","ONE","TWO"
    Link,"","","","TWO","THREE"
    Link,"","","","THREE","ONE"
  3. Save the file
  4. Open Visio
  5. Click Open
  6. Set Files of type to Text Files and click Open.
  7. Set the Field Separator to a comma(,) and click OK.
  8. Drag things around until you have a clear overview.
  9. That is it, but you might need to know a bit more. Add this line on top of the text file for automatic placement.

    PlacementStyle,4

    To use a template like Active Directory, use the following syntax. (on top of the text file)

    Template,"Active Directory.vst"

    To indicate an object, like a "site" instead of the default simple box, use the third field in the Shape line:

    Shape,"site3","site","The long version of site3"

    To find out what object names can be used, right-click an object within Visio, and check the properties.

    To add some text on a line, use the fourth field in the Link line:

    Link    ""      ""      "30"    "site2"        "site3"

    (This actually draws a line between site2 and site3, and prints 30 on that line.)

    Good luck making cool layouts!

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning robert@meinit.nl