• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Batch conversion with AGN Tools?

Messages
153
Country
unitedstates
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
 
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:
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:
Back
Top