Community
    • Login

    question on editing .cfg files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Steve SimmonsS
      Steve Simmons
      last edited by

      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?

      Claudia FrankC Jim DaileyJ 2 Replies Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Steve Simmons
        last edited by

        @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

        1 Reply Last reply Reply Quote 0
        • Jim DaileyJ
          Jim Dailey @Steve Simmons
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors