Writer’s Diary: Structur.py

Today, I worked on coding a section for the introduction to Makeshift. It was about 3,000 words, very disorganized, repetitive, and in need of cutting and more focus.

I followed the process John McPhee described in Draft No. 4:

Structur exploded my notes. It read the codes by which each note was given a destination or destinations (including the dustbin). It created and named as many new Kedit files as there were codes, and, of course, it preserved intact the original set. In my first I.B.M. computer, Structur took about four minutes to sift and separate fifty thousand words. My first computer cost five thousand dollars. I called it a five-thousand-dollar pair of scissors (John McPhee, Draft No. 4, “Chapter Structure”).

I wrote a script six months ago that extracts coded text from a folder of text files.

I’ve been using the script for months now. It splits a text file into small chunks, based on codes I added. It’s almost a manual process—not too much thought. I coded 3,000 words, split them into 10 files, put them in order, and started revising them. Much easier.

When I ran out of steam, I posted structur.py to GitHub. It’s the first script I’ve ever posted publicly. Perhaps someone will find it useful.