question on editing .cfg files



  • Hi, I need to edit a scenerycfg file and entries are numbered:

    Like so:

    [General]
    Title=Prepar3D Scenery
    Description=Prepar3D Scenery Areas Data
    Clean_on_Exit=TRUE

    [Area.001]
    Title=Default Terrain
    Texture_ID=1
    Local=Scenery\World
    Active=TRUE
    Required=TRUE
    Layer=1

    [Area.002]
    Title=Default Scenery
    Local=Scenery\BASE
    Active=TRUE
    Required=TRUE
    Layer=2

    [Area.003]
    Title=ORBX!VECTOR_AEC
    Local=ORBX\FTX_VECTOR\FTX_VECTOR_AEC
    Active=TRUE
    Required=FALSE
    Layer=3

    [Area.004]
    Title=0000 Base
    Local=Scenery\0000
    Active=TRUE
    Required=FALSE
    Layer=4

    there’s 300 entries and I need to remove one that’s number 131, and entries have to be numbered one after the other like 1-2-3-4-5, removing number 131 would leave a gap in the numbering like 129-130-132-133 and the gap in numbering would make the scenery.cfg corrupt, so to manually fix would have to renumber all entries after the entry I removed, my question is does notepad++ have a menued tool that would re-number all those entries correctly, if so which one would it be?



  • @Steve-Simmons

    my question is does notepad++ have a menued tool that would re-number all those entries correctly, if so which one would it be?

    afaik - no.

    Cheers
    Claudia



  • @Steve-Simmons

    Problems like this are easily solved using a scripting language like AWK, PERL, or Python.

    If you need to manipulate text files very often, it is well worth your time to learn one (or more) of these languages.

    AWK is the easiest to install (one exe file; I recommend gawk for windows) and use (not a ton of functions, very C-like if you are a C programmer).

    PERL and Python have much more ability to interact with other system components (that is, they can do a lot more than manipulate text), but they require you to install a bunch of files and are a bit harder to learn.

    Python is the it scripting language right now, so you’ll find lots of people willing to help you with that.


Log in to reply