Transcript to CSV Skill
Converts interview transcripts into CSV format suitable for qualitative content analysis and coding.
Input Formats Supported
Markdown format:
**SPEAKER_00**: This is what they said.
**SPEAKER_01**: And this is the response.
Plain text format:
SPEAKER_00: This is what they said.
SPEAKER_01: And this is the response.
Output Format
CSV with these columns:
#- Sequential utterance number (1, 2, 3...)Speaker- Speaker identifier (SPEAKER_00, SPEAKER_01, etc.)Utterance- The spoken textCode 1- Empty column for primary codingCode 2- Empty column for secondary codingNotes- Empty column for analyst notes
How to Convert
Option 1: Use the bundled script (recommended for large files)
cd /path/to/transcript/folder
bash scripts/parse-transcript.sh transcript.md output.csv
# scripts/parse-transcript.sh is resolved relative to this skill's folder
Option 2: One-liner for markdown transcripts
echo '#,Speaker,Utterance,Code 1,Code 2,Notes' > output.csv && \
grep '^\*\*SPEAKER' transcript.md | \
awk -F': ' 'BEGIN{n=1} {
speaker=$1;
gsub(/\*\*/,"",speaker);
utterance=$0;
sub(/^[^:]+: /,"",utterance);
gsub(/"/, "\"\"", utterance);
print n","speaker",\""utterance"\",,,";
n++
}' >> output.csv
Option 3: One-liner for plain text transcripts
echo '#,Speaker,Utterance,Code 1,Code 2,Notes' > output.csv && \
grep '^SPEAKER' transcript.txt | \
awk -F': ' 'BEGIN{n=1} {
speaker=$1;
utterance=$0;
sub(/^[^:]+: /,"",utterance);
gsub(/"/, "\"\"", utterance);
print n","speaker",\""utterance"\",,,";
n++
}' >> output.csv
Script Explanation
The parsing script does the following:
grep '^\*\*SPEAKER'- Find lines starting with**SPEAKER(markdown) orSPEAKER(plain text)awk -F': '- Split each line on:(colon-space)gsub(/\*\*/,"",speaker)- Remove**markdown formatting from speaker namesub(/^[^:]+: /,"",utterance)- Extract utterance text (everything after the first colon-space)gsub(/"/, "\"\"", utterance)- Escape quotes by doubling them (CSV standard)- Output - Format as numbered CSV row with empty coding columns
Workflow Tips
- Naming convention: Use
P1-YYYY-MM-DD.csvformat for participant files - Folder structure: Keep transcript.md, summary.md, and the CSV in the same participant folder
- After conversion: Open in Excel/Sheets to add codes in the empty columns