These jumper wires are just what you need for prototyping on a PCB. At either end there are 40 individual female connectors whilst in the middle, the wires are joined in a ribbon.
Simply pull the ribbon apart and split off what you need. For instance if you need a 4 pin cable, simply pull 4 cables off the ribbon.