NapoleonWils0n / ffmpeg-scripts

ffmpeg shell scripts
BSD 3-Clause "New" or "Revised" License
184 stars 42 forks source link

chapter-csv doesn't handle quoted field correctly #5

Closed kkew3 closed 3 months ago

kkew3 commented 3 months ago

Thanks for these great scripts! While using chapter-csv, I found that if a chapter title contains comma, the output metadata.txt will not be correct -- all texts after the first comma within the chapter title are all truncated. I looked into the source code. Unfortunately I'm not an expert in awk. Is there any possible fix for this? Thank you so much!

NapoleonWils0n commented 3 months ago

Hi Mate, try putting double quotes around the chapter title with a quote in it see if that fixes the issue with the metadata.txt file

kkew3 commented 3 months ago

Thanks for your suggestion. I tried:

  1. Quote the comma:
00:00:00,"hello, world"
00:01:00,End
  1. Escape the quote with qutoes:
00:00:00,"""hello, world"""
00:01:00,End

Neither works. I found this discussion, but since I'm not an awk expert, I totally have no idea how to apply it to this problem.

Finally, after some trials and errors I ported your awk code to Rust using csv, which solves my problem. So I'll close this issue. Thanks again!