That kind of line is not terribly straightforward in Photoshop. In my opinion, you're better off going to Illustrator, or perhaps Inkscape, for that kind of thing. I know it's fairly easy to set it up in Illustrator, but I've only used the very basics of Inkscape, so I couldn't give you any guidance there.
That said, it is possible in PS: Start by using the Pen tool or Freeform Pen tool to draw a path for your line. Then stroke it with a solid brush in the color you desire for your line on an empty layer. Make a new brush that is two vertical lines at the width of the smaller dot you desire in your line. Go to the Eraser tool and load up your new brush. Adjust the spacing so that it will hit at the frequency you desire, set the angle jitter to direction, and stroke the path with the eraser.
In case you're not familiar with the Paths feature in Photoshop: Before you draw your path go to the Paths palette, which should be behind the Layers and Channels palettes, and click the New button. This will ensure that you do not accidentally replace or add to any existing path when you make a new line. If there is already a work path there, drag that one to the New button first so you can save it for later if you need it. I suggest you keep a separate path for each line in case you want to adjust things later on or use slightly different settings for a given line. A path can be edited with the Direct Selection tool, but any strokes you've made will have to be erased and re-done if you decide to move or reshape the path. To perform the stroke, set up your brush with the brush tool selected, then go back to the Pen tool and right-click your path. Choose Stroke Path... from the context-menu, and you'll get a window with a drop-down box where you can select which tool you want to stroke it with. The tool you use will use the brush you most recently set up when you had that tool selected.