Paste every "say 37th line" apx..
-
ok…so just click on Replace All…there is no tick for exclusively, right lol
-
@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. :-)
-
ok so search for isuserselectable = 0 ; flag off for non selectable planes…so far so good lol
-
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 -
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 lineonce i get the hang of this…then i have maybe 100 more airplanes …lol
-
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?
-
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.
-
But, because you’re an admitted noob, why not do a simpler-to-understand Extended mode replacement, like this:
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?
-
-
-
-
@guy038
t seems now its just stopped replacing…say no occurences were replaced …etcThank you,
Bob M. -
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)
-
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 withisuserselectable = 0
, whatever the contents of a possible comment area, coming next the colon characterIf so, change the search regex, only, as :
SEARCH
(?-si)isuserselectable = 0.*\R\K
-
The
(?-s)
part means that anydot
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
-
-
Hey Thank you…You are awesome…thanks for all your help!! Defeinitely check out the faq…
BobM.
-
Just curious and maybe it can’t be done… but lets say I have 100 Fltsims and I want to be apostrophe’s at the beginning and end of the title line only…can that be done…here’s a sample:
[fltsim.1]
title=“JFAI_737_300_AirChina”
sim=TrafficGlobal
model=
panel=x
sound=
texture=AirChina
atc_id=B737
atc_flight_number=
atc_airline=AIR CHINA
atc_parking_codes=CCA
atc_parking_types=GATE,RAMP
ui_manufacturer=Boeing
ui_type=B733
ui_variation=Air China
description=AI
ui_typerole=Traffic Global AI
ui_createdby=Just Flight[fltsim.2]
title=“JFAI_737_300_AllNippon”
sim=TrafficGlobal
model=
panel=x
sound=
texture=AllNippon
atc_id=B737
atc_flight_number=
atc_airline=ALL NIPPON
atc_parking_codes=ANA
atc_parking_types=GATE,RAMP
ui_manufacturer=Boeing
ui_type=B733
ui_variation=All Nippon
description=AI
ui_typerole=Traffic Global AI
ui_createdby=Just FlightSo in other words…I would open the document in Notepad++ and want to put the apostrophe at the beginning and end of just the “Title line” for each fltsim section…1,2,3, etc… Might have to do a couple thousand of these…lol
i learned so much yesterday on the little I did that now I am dangerous!!!
BobM.
-
@Carolina-Number-1 said in Paste every "say 37th line" apx..:
So, presuming you have:
title=JFAI_737_300_AirChina
and you want that to be changed into:
title="JFAI_737_300_AirChina"
and that is the only thing you have on the line…
Then you could do:
find:
(?-s)^title=(.+)
repl:title="${1}"
mode: Regular expressionThere are of course some other ways, but this is probably the simplest, and I don’t think it is really worth showing a total noob some of the other ways at this point, because the confusion factor would just skyrocket.
-
Hey Thanks!! Never been called a a total noob before… I am so honored…lol
Warmest Greets…Stay Safe!!
BobM.
-
@Alan-Kilborn worked like a charm…zowie :)
BobM.
-
Hi, @carolina-number-1 and All,
I guess that you want to surround any text after the string
title =
with two double-quotes"
If so, this regex S/R is the right one :
SEARCH
(?-si)^(title\x20*=\x20*+)(?!")(.+)
REPLACE
\1"\2"
As usual :
-
Tick the
Wrap around
option and select theRegular expression
search mode -
Click, either, several times on the
Replace
button or once only on theReplace All
button
Notes :
-
The part
(?-si)^(title\x20*=\x20*)
selects the stringtitle
, with that exact case ((?-i)
), at beginning of line (^
), followed with the equal sign (=
), possibly preceded and/or followed with space char(s) (\x20*
) and stores all in group1
-
Remark that the
\x20*+
regex range of space chars, after the equal sign, defines an atomic structure. This means that no backtracking will be done, by the regex engine, in that range of spaces. In other words, this means : "search for possible space chars, after the=
sign, and verify, immediately that the next char is not a double-quote sign"
-
As said above, the part
(?!")
is a negative look-ahead structure. which tests, if, at current position, a"
symbol can be found. If not, the condition is considered as TRUE and the current match attempt is OK, so far -
Then, the part
(.+)
matches the remaining standard characters of current line and stores them as group2
-
The replacement part
\1"\2"
rewrites these two groups, with two doubles quotes surrounding the group2
Remark that the
(?!")
regex part avoids to surround an area, already surrounded with double-quotes, which would give, for instance, ““some text””, in case you would click twice on theReplace All
button@carolina-number-1, do not bother about
atomic
quantifiers andlook-around
structures, for the moment !, You have plenty of basic regex expressions to learn before ;-))Best Regards,
guy038
-
-
@guy038 Thank you!!
BobM.