aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/labels2lrc
blob: 38630c11837817aa5034aaf493fa1a5a744caede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/gawk -f
BEGIN { FS = "\t" }
{
	time = $1
	time = gensub(/([0-9]+)\.([0-9]{,2})([0-9]*)/, "\\1\\2.\\3", "g", time)
	time = int(time + 0.5)

	millis = time % 100
	time = int(time / 100)

	seconds = time % 60
	time = int(time / 60)

	minutes = time % 100

	printf("[%02d:%02d.%02d]%s\n", minutes, seconds, millis, $3)
}