Install
openclaw skills install maxqda-timecodeConvert transcript timecodes from MM:SS format to MAXQDA [hh:mm:ss] format with timecodes before speaker names, removing the first line and overwriting files.
openclaw skills install maxqda-timecodeConvert transcript timecodes from MM:SS format to MAXQDA-compatible [hh:mm:ss] format, with timecodes placed before speaker identity.
When the user asks to convert interview transcripts for MAXQDA import:
Convert timecodes in [path] for MAXQDA
把 [路径] 的时间码转成 MAXQDA 格式
提问者 00:02 (Speaker MM:SS)[00:00:02]提问者 ([hh:mm:ss]Speaker, no space)65:30 → [01:05:30]提问者)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"
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
| Input | Output |
|---|---|
提问者 00:02 | [00:00:02]提问者 |
回答者 01:30 | [00:01:30]回答者 |
提问者2 65:45 | [01:05:45]提问者2 |
Speaker MM:SS[hh:mm:ss]Speaker (no space between ] and speaker)