Batch conversion with AGN Tools?

Hi all,

I'd like to convert a batch of AGN files to TXT and back again without having to write out the names of each AGN file in the batch file. Can agn2txt convert multiple files using only one line? For instance, something like:

agn2txt *.agn > *.txt

In which the '*' denotes that all AGN files in the folder be converted to txt. I wouldn't be surprised if the tool already has this capability, but I'm a noob when it comes to batch files. I tried the above line and some variations of it, but no luck so far.

Thanks!
Scott
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Scott,

At the moment that is not supported, but what you do do is:

for %f in (*.agn) do agn2txt %f > %~nf?txt

The same can be done for the reverse as well:

for %f in (*.txt) do txt2agnx %f out_folder

But maybe for the future it's useful to add support to process multiple files. Not everybody is familiar with the cool things you can do in batch files :)
 
OK thanks, I'll give that a try. And yes, batch files are incredibly useful, and simple to make! I didnt have any experience with them up until a couple of months ago, but they have literally saved me from DAYS of mundane, repetitive and error-prone work on my current project.

Cheers,
Scott
 
You should try UNiX/Linux shell scripts - about as easy to use but immensely more powerful... I do a great deal of text file processing with them...
: )

Regards,
Scott
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
I couldn't do without my unix tools for windows indeed :). Quite easy to be able to use grep and all those others tools on windows as well.
 
This is what I use on my Windows PC - it's a pseudo Unix shell - that allows you to run all the Unix commands your familiar with - without really having to modify your OS... It's pretty slick - free - and - I like it... It will probably take a little work to get up to speed - but - it does give access to some pretty powerful text editing tools - "grep" as Arno mentioned and "sed" and "awk" which are probably my most commonly used... I'm not a real programmer by any means - I just know enough to build tools that help me with work as an admin... In MSFS - I use this to modify hundreds of *.asm (text) files at a time and then convert them to models - a task that would take me many hours to do by hand...

http://cygwin.com/

Regards,
Scott
 
Last edited:
Top