Hello,
Have a game modding problem and think Perl may be able to solve it. Bash shell scripting failed. No experience with Perl however.
( Yes, this is legal. )Goal : reorder, in a specific order, in each file alone, the lines of text. And avoid having to hand edit approximately 12,000 ANSI text files.
These ANSI files are in a very loose CSV format. Key pairs / variable = value, for example. Be warned that the "value" is often 'the-rest-of-the-line'.
Started reading 'perldoc intro' ... did not go well.
I have only shell scripting experience and am unable to comprehend/learn high level programming languages ( ASSEMBLY / BASIC = yes, PASCAL / C = no ).
Thank you for your time and consideration.I have put together the following files. A file name list 'filelist.txt', and a template containing the reordered lines of text ( by first word of the line ) called 'template.txt'.
I can supply an 'unedited' file as well as a 're-ordered' file. The files have an .odf extension but are really renamed ANSI .txt files.
Sample of 'filelist.txt'
bor_adaptorC.odf bor_adaptor_EE_M.odf bor_adaptor_EE.odf bor_adaptor_EO.odf bor_adaptor_OO.odf bor_adaptor_RE.odf bor_adaptor_RO.odf bor_adaptor_TE.odf bor_adaptor_TO.odf bor_adaptor_TR.odf bor_assemblerY.odf bor_assemblerYS.odf bor_assemblerZ.odf bor_assemblerZS.odf bor_assimilator_AAA.odf bor_assimilator_BAA.odf bor_assimilator_BRA.odf bor_assimilator_BTA.odf bor_assimilator_BTR.odf bor_assimilator_BTT.odf
Sample of 'template.txt'
unitname tooltip verbosetooltip race buildtime officercost crewcost dilithiumcost latinumcost metalcost biomattercost maxHealth curHealth healthrate maxshield curShield shieldrate maxSpecialEnergy specialEnergyRate specialenergydisplaymode
In reply to re-ordering lines of text in a file? by moddingforfun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |