Back

How to remove the Chinese lines from Bilingual subs?

#1
Previously, Kuroro posted a similiar question in this forum under "Koohii Lounge"  but that thread has disappeared due to the forum upgrade (I guess...) 
Quote:早かったわね\N{\fn方正中倩简体}{\fs50}真早呢

However I noticed that in every line between the Japanese and the Chinese part these characters '\N{\fn方正中倩简体}{\fs50}' always appear, so I was wondering if there was a way to have the software automatically delete them, and what follows, in every line.

ReneSac suggested the following Regex search and replace using Sublime Text:

Quote:\\N\{\\fn方正中倩简体\}\{\\fs50\}.*$

Is it possible to delete just the Chinese characters which always appear before
\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}  
Quote:是 是\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}はいはい…
老师\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}先生!

I am not familiar with Regex string expression, and wonder if there is a way to delete only the Chinese part in the above situation?

Thank you in advance for any help or advice.

EDIT: ファブリス have decided to return the Off Topics threads from Koohii Lounge back here. This is Kuroro's thread http://forum.koohii.com/thread-13082.html
Edited: 2015-11-25, 2:24 am
Reply
#2
Try:

Find What: ^.*\\N
Replace With: \\N

This will replace your example text with:

Quote:\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}はいはい…
\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}先生!

Is ok?
Reply
#3
You could download aegisub and manually delete the Chinese lines.
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
#4
(2015-11-17, 12:20 pm)aldebrn Wrote: Try:

Find What: ^.*\\N
Replace With: \\N

This will replace your example text with:

Quote:\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}はいはい…
\N{\fnMS Gothic}{\fs12}{\b0}{\c&HFFFFFF&}{\3c&H2F2F2F&}{\4c&H000000&}先生!

Is ok?
Reply
#5
Thank you, aldebrn. Your suggestion works. Brilliant!
Reply
#6
After fiddling with the string expressions, it is possible to remove the Chinese lines in-between the bilingual subtitles by using Regex Match all characters between two strings syntax as follows:
(?<=beginningstringname)(.*\n?)(?=endstringname)

EXAMPLE:
Dialogue: 0,0:00:18.18,0:00:19.19,con,NTP,0,0,0,,老师\N{\fn方正中倩简体}{\fs50}先生!

Find What: (?<=con,NTP,0,0,0,,)(.*\n?)(?=\\N)
Replace With:
[Image: Remove%20Chinese%20lines%20from%20Biling...titles.jpg]
EDIT: added image file
Edited: 2015-11-24, 9:25 am
Reply
#7
I'm not so savvy with look-behinds, but this should work:


Replace:  ^(.*?con,NTP,0,0,0,,)(.*?)(\\N.*$)
Replace with: \1\3

see here for info on how back references work.
Reply
#8
Oi, where are you finding these bilingual Cn–Jp subs? They look fun ?
Reply
#9
(2015-11-24, 8:08 am)aldebrn Wrote: Oi, where are you finding these bilingual Cn–Jp subs? They look fun ?
えっと、えっと、..... from the Chinese private websites.

Just added an image link (above) to show how it looks like. What do you think?

Kuroro got some of them from kitsunekko.
http://forum.koohii.com/thread-13082.html
Quote:I found the subtitles for さくら荘のペットな彼女 on Kitsunekko, but when I open them in Aegisub the two languages are not separated
Reply
#10
(2015-11-23, 6:43 pm)yogert909 Wrote: I'm not so savvy with look-behinds, but this should work:

Replace:  ^(.*?con,NTP,0,0,0,,)(.*?)(\\N.*$)
Replace with: \1\3

see here for info on how back references work.
Thank you for your suggestion, but that syntax does not work.
Reply
#11
(2015-11-24, 9:28 am)eslang Wrote:
(2015-11-23, 6:43 pm)yogert909 Wrote: I'm not so savvy with look-behinds, but this should work:

Replace:  ^(.*?con,NTP,0,0,0,,)(.*?)(\\N.*$)
Replace with: \1\3

see here for info on how back references work.
Thank you for your suggestion, but that syntax does not work.

Hmm, works for me in text wrangler.  I think some regex uses $ for backreferences so maybe this will work for you:

Replace:  ^(.*?con,NTP,0,0,0,,)(.*?)(\\N.*$)
Replace with: $1$3
Reply
#12
(2015-11-22, 10:59 pm)eslang Wrote: After fiddling with the string expressions, it is possible to remove the Chinese lines in-between the bilingual subtitles by using Regex Match all characters between two strings syntax as follows:
(?<=beginningstringname)(.*\n?)(?=endstringname)
Are you just describing a solution you found, or are you asking a question about this regex?
Reply
#13
(2015-11-24, 1:59 pm)yogert909 Wrote: Hmm, works for me in text wrangler.  I think some regex uses $ for backreferences so maybe this will work for you:

Replace:  ^(.*?con,NTP,0,0,0,,)(.*?)(\\N.*$)
Replace with: $1$3
やった! It works beautifully this time. サンキュー Heart
Reply
#14
(2015-11-24, 8:43 pm)aldebrn Wrote: Are you just describing a solution you found, or are you asking a question about this regex?
Both - describing a solution and asking a question at the same time.
Just curious to know, how many ways to achieve the same result. Big Grin
¯\_(ツ)_/¯
Edited: 2015-11-25, 2:17 am
Reply