MAXQDA Timecode Converter
by @kiriny1999
Convert transcript timecodes from MM:SS format to MAXQDA [hh:mm:ss] format with timecodes before speaker names, removing the first line and overwriting files.
clawhub install maxqda-timecodeð About This Skill
name: maxqda-timecode description: Convert transcript timecodes from MM:SS format to MAXQDA-compatible [hh:mm:ss] format for qualitative research data import. version: 1.0.0 author: @Kiriny1999
MAXQDA Timecode Converter
Convert transcript timecodes from MM:SS format to MAXQDA-compatible [hh:mm:ss] format, with timecodes placed before speaker identity.
Usage
When the user asks to convert interview transcripts for MAXQDA import:
Convert timecodes in [path] for MAXQDA
æ [è·¯åŸ] çæ¶éŽç 蜬æ MAXQDA æ ŒåŒ
What It Does
1. Removes the first line (title/header)
2. Converts timecodes and repositions them:
- Input: æé®è
00:02 (Speaker MM:SS)
- Output: [00:00:02]æé®è
([hh:mm:ss]Speaker, no space)
3. Handles hours correctly when minutes exceed 60 (e.g., 65:30 â [01:05:30]æé®è
)
4. Overwrites the original file
One-Step Conversion Script
perl -ne '
next if $. == 1; # Skip first line (title)
# Remove BOM if present
s/^\x{FEFF}//;
# Convert: Speaker MM:SS -> [hh:mm:ss]Speaker (no space)
if (/^(\S+)\s+(\d{2}):(\d{2})/) {
$speaker = $1;
$mm = $2;
$ss = $3;
$hh = int($mm / 60);
$mm = $mm % 60;
s/^(\S+)\s+(\d{2}):(\d{2})/sprintf("[%02d:%02d:%02d]%s", $hh, $mm, $ss, $speaker)/e;
}
print;
' "$INPUT_FILE" > "$TEMP_FILE" && mv "$TEMP_FILE" "$INPUT_FILE"
Batch Processing
To process all .txt files in a directory:
for f in "/path/to/directory/"*.txt; do
perl -ne '
next if $. == 1;
s/^\x{FEFF}//;
if (/^(\S+)\s+(\d{2}):(\d{2})/) {
$speaker = $1;
$mm = $2;
$ss = $3;
$hh = int($mm / 60);
$mm = $mm % 60;
s/^(\S+)\s+(\d{2}):(\d{2})/sprintf("[%02d:%02d:%02d]%s", $hh, $mm, $ss, $speaker)/e;
}
print;
' "$f" > "${f}.tmp" && mv "${f}.tmp" "$f"
done
Format Examples
| Input | Output |
|-------|--------|
| æé®è
00:02 | [00:00:02]æé®è
|
| åçè
01:30 | [00:01:30]åçè
|
| æé®è
2 65:45 | [01:05:45]æé®è
2 |
Notes
Speaker MM:SS[hh:mm:ss]Speaker (no space between ] and speaker)ð¡ Examples
When the user asks to convert interview transcripts for MAXQDA import:
Convert timecodes in [path] for MAXQDA
æ [è·¯åŸ] çæ¶éŽç 蜬æ MAXQDA æ ŒåŒ
ð Tips & Best Practices
Speaker MM:SS[hh:mm:ss]Speaker (no space between ] and speaker)