• Login
Community
  • Login

Paste every "say 37th line" apx..

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
30 Posts 3 Posters 1.7k 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.
  • C
    Carolina Number 1
    last edited by Carolina Number 1 Feb 27, 2021, 12:23 PM Feb 27, 2021, 12:20 PM

    I know this is strange but trying to figure out how to do this about 342 times…lol…
    I want to paste this…sound = “sound” ; sound folder

    Note the location of this line is after or just under this line: isuserselectable = 0 ; flag off for non selectable planes

    If i counted it about 37 lines below to next instance or can it just be inserted automatically after/under this line every time it appears in document? isuserselectable = 0 ; flag off for non selectable planes There are 342 instances of this and it would kill me to add this 342x…lol…any ideas…

    Here’s what it would look like:
    [FLTSIM.274]

    ; LEGACY
    title = AIGAIM_Thai AirAsia Airbus A320-200 - Truely ASEAN ; Variation name
    model = CFM AIQ-Thai AirAsia_Truely ASEAN ; model folder
    texture = AIQ-Thai AirAsia_Truely ASEAN ; texture folder
    atc_airline = THAI ASIA ; airline name
    atc_parking_types =RAMP,GATE ; “ANY” / “RAMP” / “CARGO” / “MIL_CARGO” / “MIL_COMBAT” / “GATE” / “DOCK”
    atc_parking_codes = AIQ ; Comma separated and may be as small as one character each
    icao_airline = “AIQ” ; ###
    ui_type = Airbus A320-200 ; e.g. 747-400, 172
    isairtraffic = 1 ; airtraffic flag for variations
    isuserselectable = 0 ; flag off for non selectable planes
    sound = “sound” ; sound folder
    ; MODERN
    ;-panel = “” ; panel folder
    ;-sound = “” ; sound folder
    ;-kb_checklists = “” ; Procedures/Checklist sibling file name
    ;-kb_reference = “” ; Reference information sibling file name
    ;-description = “$$:Generic plane for Air Traffic” ; Variation description.
    ;-wip_indicator = 0 ; know if the variation is good to go or still WIP : -1=Disabled, 0=Rough, 1=1st Pass, 2=Finished
    ;-ui_manufacturer = “$$:Generic” ; e.g. Boeing, Cessna
    ;-ui_variation = “$$:Default” ; e.g. World Air, IFR Panel
    ;-ui_typerole = “Single Engine Prop” ; e.g. Single Engine Prop, Twin Engine Prop, Rotorcraft, etc
    ;-ui_createdby = “Asobo Studio” ; e.g. Asobo Studio, Microsoft, FSAddonCompany, etc
    ;-ui_thumbnailfile = “” ; app relative path to ThumbNail image file
    ;-ui_certified_ceiling = -1 ; service ceiling / max certified operating altitude (ft)
    ;-ui_max_range = -1 ; max distance the aircraft can fly between take-off and landing in (NM)
    ;-ui_autonomy = -1 ; max duration the aircraft can fly between take-off and landing in (Hrs)
    ;-ui_fuel_burn_rate = -1 ; average fuel consumption per hour (lbs/hr) - reminder: fuel density is ~6.7lbs per US gallon
    ;-atc_id = “AS-SGP1” ; tail number
    ;-atc_id_enable = 1 ; enable tail number
    ;-atc_flight_number = “” ; flight number
    ;-atc_heavy = 0 ; heavy?
    ;-atc_id_color = “” ; color for the tail number : i.e. “#ffff00ff”
    ;-atc_id_font = “” ; font for the tail number
    ;-sim = Cessna172SP ;

    [FLTSIM.275]

    ; LEGACY
    title = AIGAIM_Thai VietJet Air Airbus A320-200 ; Variation name
    model = CFM TVJ-Thai VietJet Air ; model folder
    texture = TVJ-Thai VietJet Air ; texture folder
    atc_airline = THAIVIET JET ; airline name
    atc_parking_types =RAMP,GATE ; “ANY” / “RAMP” / “CARGO” / “MIL_CARGO” / “MIL_COMBAT” / “GATE” / “DOCK”
    atc_parking_codes = TVJ ; Comma separated and may be as small as one character each
    icao_airline = “TVJ” ; ###
    ui_type = Airbus A320-200 ; e.g. 747-400, 172
    isairtraffic = 1 ; airtraffic flag for variations
    isuserselectable = 0 ; flag off for non selectable planes
    sound = “sound” ; sound folder
    ; MODERN
    ;-panel = “” ; panel folder
    ;-sound = “” ; sound folder
    ;-kb_checklists = “” ; Procedures/Checklist sibling file name
    ;-kb_reference = “” ; Reference information sibling file name
    ;-description = “$$:Generic plane for Air Traffic” ; Variation description.
    ;-wip_indicator = 0 ; know if the variation is good to go or still WIP : -1=Disabled, 0=Rough, 1=1st Pass, 2=Finished
    ;-ui_manufacturer = “$$:Generic” ; e.g. Boeing, Cessna
    ;-ui_variation = “$$:Default” ; e.g. World Air, IFR Panel
    ;-ui_typerole = “Single Engine Prop” ; e.g. Single Engine Prop, Twin Engine Prop, Rotorcraft, etc
    ;-ui_createdby = “Asobo Studio” ; e.g. Asobo Studio, Microsoft, FSAddonCompany, etc
    ;-ui_thumbnailfile = “” ; app relative path to ThumbNail image file
    ;-ui_certified_ceiling = -1 ; service ceiling / max certified operating altitude (ft)
    ;-ui_max_range = -1 ; max distance the aircraft can fly between take-off and landing in (NM)
    ;-ui_autonomy = -1 ; max duration the aircraft can fly between take-off and landing in (Hrs)
    ;-ui_fuel_burn_rate = -1 ; average fuel consumption per hour (lbs/hr) - reminder: fuel density is ~6.7lbs per US gallon
    ;-atc_id = “AS-SGP1” ; tail number
    ;-atc_id_enable = 1 ; enable tail number
    ;-atc_flight_number = “” ; flight number
    ;-atc_heavy = 0 ; heavy?
    ;-atc_id_color = “” ; color for the tail number : i.e. “#ffff00ff”
    ;-atc_id_font = “” ; font for the tail number
    ;-sim = Cessna172SP ;

    [FLTSIM.276]

    ; LEGACY
    title = AIGAIM_Thai VietJet Air Airbus A320-200 - Albino ; Variation name
    model = CFM TVJ-Thai VietJet Air_Albino ; model folder
    texture = TVJ-Thai VietJet Air_Albino ; texture folder
    atc_airline = THAIVIET JET ; airline name
    atc_parking_types =RAMP,GATE ; “ANY” / “RAMP” / “CARGO” / “MIL_CARGO” / “MIL_COMBAT” / “GATE” / “DOCK”
    atc_parking_codes = TVJ ; Comma separated and may be as small as one character each
    icao_airline = “TVJ” ; ###
    ui_type = Airbus A320-200 ; e.g. 747-400, 172
    isairtraffic = 1 ; airtraffic flag for variations
    isuserselectable = 0 ; flag off for non selectable planes
    sound = “sound” ; sound folder

    Ithe sound line needs to go just under the line above it 342 times…yikes… Hope you’re not lost… Thank you so much for any help!!

    BobM.

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Feb 27, 2021, 1:17 PM Feb 27, 2021, 12:47 PM

      Hello, @carolina-number-1 and All,

      If I understand you properly, you would like to insert the line sound = "sound" ; sound folder right after each line isuserselectable = 0 ; flag off for non selectable planes of the current file !

      I assume, too, that the desired replacement is the string sound = "sound" ; sound folder and NOT the string sound = “sound” ; sound folder

      In this case, I suppose that this regex S/R should work nice :

      SEARCH (?-i)isuserselectable = 0 ; flag off for non selectable planes\R\K

      REPLACE sound = "sound" ; sound folder\r\n    ( OR sound = "sound" ; sound folder\n if UNIX files )

      Notes :

      • Tick the Wrap around option

      • Use the Regular expression search mode

      • Click, exclusively on the Replace All button

      • After searching for the line isuserselectable = 0 ; flag off for non selectable planes, respecting the case (?-i) and its line-ending characters \R, the \K feature resets the search and simply matches the zero-length location, right after this line

      • Then, the replacement string sound = "sound" ; sound folder is just added with its line-ending characters \r\n

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 1
      • C
        Carolina Number 1
        last edited by Carolina Number 1 Feb 27, 2021, 1:16 PM Feb 27, 2021, 1:14 PM

        OMG…Fantastic…reading this and figuring how to do this…
        Bestest!!

        BobM.

        A 1 Reply Last reply Feb 27, 2021, 1:20 PM Reply Quote 0
        • A
          Alan Kilborn @Carolina Number 1
          last edited by Alan Kilborn Feb 27, 2021, 1:20 PM Feb 27, 2021, 1:20 PM

          @Carolina-Number-1

          The key part seems to be needing to know the way to insert a line-break.
          I’m not much for Extended search mode, but I think you could use it here to do what you want… you would use \r\n in your replacement string where you wanted a line-break.
          It’s a little bit simpler to figure out than regular expressions, so that’s why I’m mentioning it.

          C 1 Reply Last reply Feb 27, 2021, 1:21 PM Reply Quote 0
          • C
            Carolina Number 1
            last edited by Feb 27, 2021, 1:20 PM

            In the “Replace All”…don’t see a “exclusively”,

            Thanks so far, BobM.

            A 1 Reply Last reply Feb 27, 2021, 1:22 PM Reply Quote 0
            • C
              Carolina Number 1 @Alan Kilborn
              last edited by Feb 27, 2021, 1:21 PM

              @Alan-Kilborn

              total newbie here

              A 1 Reply Last reply Feb 27, 2021, 1:24 PM Reply Quote 1
              • A
                Alan Kilborn @Carolina Number 1
                last edited by Alan Kilborn Feb 27, 2021, 1:22 PM Feb 27, 2021, 1:22 PM

                @Carolina-Number-1 said in Paste every "say 37th line" apx..:

                In the “Replace All”…don’t see a “exclusively”,

                LOL. Guy is French so sometimes his wording is “interesting”. :-)
                (In general though, his English is very good, indeed)

                Click, exclusively on the Replace All button

                What is meant here is that you can’t use the Replace button for this action; you have to use Replace All to perform the replacement.

                1 Reply Last reply Reply Quote 1
                • C
                  Carolina Number 1
                  last edited by Feb 27, 2021, 1:24 PM

                  ok…so just click on Replace All…there is no tick for exclusively, right lol

                  1 Reply Last reply Reply Quote 1
                  • A
                    Alan Kilborn @Carolina Number 1
                    last edited by Feb 27, 2021, 1:24 PM

                    @Carolina-Number-1 said in Paste every "say 37th line" apx..:

                    total newbie here

                    :-) Welcome.

                    If you have questions about what advice we give, certainly ask. :-)

                    C 1 Reply Last reply Feb 27, 2021, 1:31 PM Reply Quote 0
                    • C
                      Carolina Number 1
                      last edited by Feb 27, 2021, 1:25 PM

                      ok so search for isuserselectable = 0 ; flag off for non selectable planes…so far so good lol

                      C 1 Reply Last reply Feb 27, 2021, 1:28 PM Reply Quote 0
                      • C
                        Carolina Number 1 @Carolina Number 1
                        last edited by Feb 27, 2021, 1:28 PM

                        @Carolina-Number-1

                        not sure about what of this goes in the search line?
                        After searching for the line isuserselectable = 0 ; flag off for non selectable planes, respecting the case (?-i) and its line-ending characters \R, the \K feature resets the search and simply matches the zero-length location, right after this line

                        1 Reply Last reply Reply Quote 0
                        • C
                          Carolina Number 1 @Alan Kilborn
                          last edited by Carolina Number 1 Feb 27, 2021, 1:32 PM Feb 27, 2021, 1:31 PM

                          @Alan-Kilborn

                          not sure about what of this goes in the search line?
                          After searching for the line isuserselectable = 0 ; flag off for non selectable planes, respecting the case (?-i) and its line-ending characters \R, the \K feature resets the search and simply matches the zero-length location, right after this line

                          once i get the hang of this…then i have maybe 100 more airplanes …lol

                          A 2 Replies Last reply Feb 27, 2021, 1:38 PM Reply Quote 0
                          • A
                            Alan Kilborn @Carolina Number 1
                            last edited by Feb 27, 2021, 1:38 PM

                            @Carolina-Number-1

                            So, when @guy038 said:

                            SEARCH (?-i)isuserselectable = 0 ; flag off for non selectable planes\R\K

                            REPLACE sound = “sound” ; sound folder\r\n ( OR sound = “sound” ; sound folder\n if UNIX files )

                            He meant for “SEARCH” that you would put this in the box labeled Find what:

                            And correspondingly, “REPLACE” means look for the Replace with box.

                            Does that help?

                            C 1 Reply Last reply Feb 27, 2021, 1:43 PM Reply Quote 2
                            • C
                              Carolina Number 1 @Alan Kilborn
                              last edited by Feb 27, 2021, 1:43 PM

                              @Alan-Kilborn

                              yeah…I think I lost my “isuserselectable = 0 ; flag off for non selectable planes” because it replaced it with the sound stuff…lol but it added sound i think 736 times…so rather than replace that line…insert the sound line below it…this was on a trial cfg not the real one yet till i get this down.

                              1 Reply Last reply Reply Quote 0
                              • A
                                Alan Kilborn @Carolina Number 1
                                last edited by Alan Kilborn Feb 27, 2021, 1:45 PM Feb 27, 2021, 1:45 PM

                                @Carolina-Number-1

                                But, because you’re an admitted noob, why not do a simpler-to-understand Extended mode replacement, like this:

                                58fdc235-dae6-4e51-beba-5e5351f3f61f-image.png

                                Notice:

                                • the Search mode has been set to Extended – this allows you to do fancy things (over and above what a Normal search allows) like specify multiple lines in your data (here you are replacing one-line with two (the original plus a new one).

                                • the \r\n in the Replace with data is what creates a second line in your data; it is the “dividing point” between two lines

                                Is this easier to see/understand?

                                1 Reply Last reply Reply Quote 2
                                • G
                                  guy038
                                  last edited by Feb 27, 2021, 1:45 PM

                                  Hi, @carolina-number-1

                                  eeb17561-1990-459b-a59d-9676327f3b76-image.png

                                  BR

                                  guy038

                                  C 2 Replies Last reply Feb 27, 2021, 1:48 PM Reply Quote 0
                                  • C
                                    Carolina Number 1 @guy038
                                    last edited by Feb 27, 2021, 1:48 PM

                                    @guy038

                                    Hey Thanks All!!!

                                    You are great!!!

                                    I am 70 and a tad slow but getting it, i think lol

                                    1 Reply Last reply Reply Quote 1
                                    • C
                                      Carolina Number 1 @guy038
                                      last edited by Feb 27, 2021, 2:54 PM

                                      @guy038
                                      t seems now its just stopped replacing…say no occurences were replaced …etc

                                      Thank you,
                                      Bob M.

                                      1 Reply Last reply Reply Quote 0
                                      • C
                                        Carolina Number 1
                                        last edited by Feb 27, 2021, 3:37 PM

                                        If I need to change this: isuserselectable = 0 ; flag off for non selectable planes to this:

                                        isUserSelectable = 0 ; (on the end of search line after 0 ; \R\K

                                        and still replace with:

                                        sound = “sound” ; sound folder (sound = “sound” ; sound folder\r\n)

                                        1 Reply Last reply Reply Quote 0
                                        • G
                                          guy038
                                          last edited by guy038 Feb 27, 2021, 6:01 PM Feb 27, 2021, 5:53 PM

                                          @carolina-number-1,

                                          Your last post isn’t quite clear but I guess you would like to add the line sound = "sound" ; sound folder right after each line beginning with isuserselectable = 0, whatever the contents of a possible comment area, coming next the colon character

                                          If so, change the search regex, only, as :

                                          SEARCH (?-si)isuserselectable = 0.*\R\K

                                          • The (?-s) part means that any dot meta-character matches a single standard character

                                          • The .* syntax, before the \R , represents the area, possibly empty, of standard character(s), after the string = 0 and before the EOL chars

                                          I advice you to get documentation on the regex world, in this FAQ

                                          Best regards,

                                          guy038

                                          C 1 Reply Last reply Feb 28, 2021, 1:39 PM Reply Quote 0
                                          7 out of 30
                                          • First post
                                            7/30
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors