[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/jp/ - Otaku Culture


View post   

File: 403 KB, 1600x900, tooooolong.png [View same] [iqdb] [saucenao] [google]
12182262 No.12182262 [Reply] [Original]

I'm working on patching an unvalidated copy of F/HA right now and I was wondering, is there is a faster way to replace text than to find and replace every bit line by line?

>> No.12182269

You're doing god's work anon.
And I'm sure there is, but it likely involves scripts doing it for you.

>> No.12182270
File: 359 KB, 792x540, 1402031758737.png [View same] [iqdb] [saucenao] [google]
12182270

>>12182262
Write a script to replace the lines

>> No.12182274

>>12182270
Would it be faster to spend about a week copying and replacing line by line or to learn how to write a script?

>> No.12182284

>>12182274
Why don't you already know how to write scripts?

If you think either would take the same amount of time, at least learning how to write a script gives you the added bonus of knowing how to script.

>> No.12182306

>>12182284
What sort of thing do I look up to start learning how to do this?

>> No.12182323

>>12182306
You could try python. It's the hip new language.

Although any scripting language that can take inputs and outputs is fine. I personally like to use GNU/Linux command-line bash scripting, but that's just me. You can try it out with Cygwin.

>> No.12182350

>>12182306
Learn about the magic of Perl.
There are no other scripting languages worth your time.
http://perl-tutorial.org/

>> No.12182576 [DELETED] 

I mean honestly if you just took that data and put it in some manageable format you could probably do this with something like autohotkey.

It's probably not the elegant solution others are imagining but it will work and you can write something for AHK quicker than you'll learn perl

>> No.12185584

>>12182274
It's not worth it for one-time use, but it will start saving you time and effort in the long run.
If you're looking at Python, your more-or-less usable result should be somewhat like this:
http://pastebin.com/5HHWd7rh

>> No.12186402

Write a script. It's trivial in any language, and even if it takes you a while to figure out, like others said you'll have the benefit of knowing how to do a similar script in the future.

I remember writing a script to do pretty much exactly what you're doing now a few years back in AutoIt, I'd post the source but I don't have it on me.

>> No.12186415

>>12182323
>GNU/Linux command-line bash scripting
You must be masochistic. Or, let me correct that... [ -e "masochistic" ];

>> No.12186943

If you specify what exactly needs to be done im sure i could write it for you. Doesnt sound very complicated

>> No.12186974

>>12182262
vomit inducing, poorly phrased, message missed, incoherent, dribble lines which only have two hints of inspired moments ever gracing it's ugly head in his mind.

>> No.12187043

Reminds me of how /jp/ worked on adding voices to Koihime, initially they did it line by line until they found a way to automate it.

>> No.12188148

>>12186943
It doesn't look like OP is still around, but if you're willing to demonstrate your skills...

Basically, get "line=N" tags from .po text file and replace Nth line in corresponding .ks file with matching line from .po, that's it.
Pictured .po file can be downloaded from Entrans, FateHA > Street > 街編・1日目-04.ks.po
Can't help with the .ks, but OP's screenshot has everything you need.
BTW, Python script is incomplete but it works and I can't be bothered to polish it even more.

>>
Name
E-mail
Subject
Comment
Action