I have this file "time.txt":
1:53 5:38
5:46 8:17
8:19 12:37
and I want to use it in batch tasks, the test cmd is like this:
awk '{ print "ffmpeg -i 1.mp4 -ss "$1" -to "$2" -y -c copy " }' time.txt
The output is like this:
-y -c copy mp4 -ss 1:53 -to 5:38
-y -c copy mp4 -ss 5:46 -to 8:17
-y -c copy mp4 -ss 8:19 -to 12:37
What is wrong? (It looks like the strings are overwritten when it should be concatenated.)
The cause found:
The file "time.txt" has windows-type new-line characters, which upsets awk's work. After converting them to unix-type, awk works well.