我以sed開頭。 任何人都可以引導我如何解決這個問題? 我開始用這個和我的sed的現在基本命令:在sed中使用字幕
{0}{20}First subtitle
{30}{50}Second subtitle|New line is made this way.
{70}{100}Third.
{1010}{1033}Fourth etc.
括號中的數字是指開始和結束,其中字幕應該是可見的。 讓我們有一個翻譯誰將使字幕翻譯這樣( 我會簽署這份文本(*)):
{0}{20}First subtitle
Translation of the first subtitle.
{30}{50}Second subtitle|New line is made this way.
Translation of the second subtitle.|Second line of translation of the second subtitle.
{70}{100}Third.
Translation of third.
{1010}{1033}Fourth etc.
Translation of fourth etc.
我需要做3件事情: 1)獨立的翻譯字幕:
{0}{20}Translation of the first subtitle.
{30}{50}Translation of the second subtitle|Second line of translation of the second subtitle.
{70}{100}Translation of third.
{1010}{1033}Translation of fourth etc.
2)從兩個字幕(帶*號)只有原來subtiltes簽署的文本分開,並得到這個:
{0}{20}First subtitle
{30}{50}Second subtitle|New line is made this way.
{70}{100}Third.
{1010}{1033}Fourth etc.
3)從1使輸出)和2),得到既字幕(簽字*)原文:
{0}{20}First subtitle
Translation of the first subtitle.
{30}{50}Second subtitle|New line is made this way.
Translation of the second subtitle.|Second line of translation of the second subtitle.
{70}{100}Third.
Translation of third.
{1010}{1033}Fourth etc.
Translation of fourth etc.
可有人請給我一些建議如何開始?非常感謝。
我也許應該提到(這應該是清楚的),我會打電話給它這樣的:
cat input_file.txt | sed <"program" in sed>
[作業標籤已被棄用,不應再使用。](http://meta.stackexchange.com/questions/147100/trogdor-ate-my-homework-tag) – Lion
什麼是「翻譯」?你有什麼嘗試?另外,你不需要在'sed'中使用'cat'。 –
翻譯正在將一種語言的文本轉換爲另一種語言。 和你剛纔翻譯的書一樣,例如從法語到英語等。在這種情況下,我只用一種語言翻譯原文,並用其他語言翻譯文本。我在sed嘗試了另一項任務,但我不知道從哪裏開始。我知道我不需要使用貓 - 這只是如何運行它的一種方式。 – user1097772