With many thanks to the fascinating book Connections by James Burke, that contained this story. I loved the TV programme of the same name.

A significant invention of the English Industrial Revolution was the power loom; a loom powered by water or steam that wove cloth much faster than could be done by hand. To automate the lifting of the threads, which makes the pattern on the cloth, a cylinder was designed with a series of holes that lifted (or did not lift) the threads. Eventually the cylinder was replaced by cards with a series of holes to indicate the pattern. In the USA census of 1890, they used the same cards, but the holes represented age, sex etc. The census count was completed in half the time. Within a few years punch cards were used in counting machines and eventually in computers (for the yes / no operating code that is still in use today).