res.dat
수정해야 할 일부 데이터가 포함된 대용량 파일이 있습니다 . 모든 데이터는 한 줄에 있습니다.
예를 들어:
L1TRAIN="200" NEEDL2="14" L2TRAIN="300" NEEDL3="16" L3TRAIN="400" NEEDL4="99" L4TRAIN="600" NEEDL5="99" L5TRAIN="900" DELAY="60" COOLTIME="0" KORNAME="화염풍" SKILLTYPE="0" TOOLTIP="A defensive spell that allows you to push away enemies of lower level. This spell has a fixed chance for success. The range of the spell and chance of success increase with training." /><VALUE MAGID="9" MAGNAME="Lavastrike" TYPE="0" EFFECTTYPE="5" EFFECT="7" SPELL="11" POWER="14" MAXPOWER="18" DEFSPELL="15" DEFPOWER="12" DEFMAXPOWER="16" JOB="1" PHASE="0" NEEDL1="20" L1TRAIN="500" NEEDL2="22" L2TRAIN="600" NEEDL3="24" L3TRAIN="700" NEEDL4="99" L4TRAIN="900" NEEDL5="99" L5TRAIN="1200" DELAY="80" COOLTIME="0" KORNAME="염사장" SKILLTYPE="0" TOOLTIP="A spell that shoots out line of fire along the ground, damaging all enemies caught within the fire. Its damage increases with training." /><VALUE MAGID="10" MAGNAME="LightningBeam" TYPE="2" EFFECTTYPE="6" EFFECT="8" SPELL="12" POWER="14" MAXPOWER="14" DEFSPELL="15" DEFPOWER="12" DEFMAXPOWER="16" JOB="1" PHASE="0" NEEDL1="21" L1TRAIN="500" NEEDL2="23" L2TRAIN="600" NEEDL3="25" L3TRAIN="700" NEEDL4="99" L4TRAIN="900" NEEDL5="99" L5TRAIN="1200" DELAY="80" COOLTIME="0" KORNAME="뢰인장" SKILLTYPE="0"
L1TRAIN
, , 및 큰따옴표 안의 데이터를 찾아 수정해야 하는 페이로드 로 모두 L2TRAIN
한 줄에 업데이트하는 스크립트를 실행해야 합니다.L3TRAIN
L4TRAIN
L5TRAIN
L1TRAIN="100" L2TRAIN="200" L3TRAIN="300" L4TRAIN="400" L5TRAIN="500"
이 예제의 출력은 다음과 같아야 합니다.
L1TRAIN="100" NEEDL2="14" L2TRAIN="200" NEEDL3="16" L3TRAIN="300" NEEDL4="99" L4TRAIN="400" NEEDL5="99" L5TRAIN="500" DELAY="60" COOLTIME="0" KORNAME="화염풍" SKILLTYPE="0" TOOLTIP="A defensive spell that allows you to push away enemies of lower level. This spell has a fixed chance for success. The range of the spell and chance of success increase with training." /><VALUE MAGID="9" MAGNAME="Lavastrike" TYPE="0" EFFECTTYPE="5" EFFECT="7" SPELL="11" POWER="14" MAXPOWER="18" DEFSPELL="15" DEFPOWER="12" DEFMAXPOWER="16" JOB="1" PHASE="0" NEEDL1="20" L1TRAIN="100" NEEDL2="22" L2TRAIN="200" NEEDL3="24" L3TRAIN="300" NEEDL4="99" L4TRAIN="400" NEEDL5="99" L5TRAIN="500" DELAY="80" COOLTIME="0" KORNAME="염사장" SKILLTYPE="0" TOOLTIP="A spell that shoots out line of fire along the ground, damaging all enemies caught within the fire. Its damage increases with training." /><VALUE MAGID="10" MAGNAME="LightningBeam" TYPE="2" EFFECTTYPE="6" EFFECT="8" SPELL="12" POWER="14" MAXPOWER="14" DEFSPELL="15" DEFPOWER="12" DEFMAXPOWER="16" JOB="1" PHASE="0" NEEDL1="21" L1TRAIN="100" NEEDL2="23" L2TRAIN="200" NEEDL3="25" L3TRAIN="300" NEEDL4="99" L4TRAIN="400" NEEDL5="99" L5TRAIN="500" DELAY="80" COOLTIME="0" KORNAME="뢰인장" SKILLTYPE="0"
답변1
한 가지 방법은 다음과 같습니다 sed
.
sed 's/\(L\([1-5]\)TRAIN="\)[^"]*/\1\200/g' res.dat
이는 그룹화 및 역참조를 사용하여 다음 항목을 대체합니다.
엘Ntrain = "아무거나_제외_이중_인용문
그리고
엘N훈련 =N00
어디N1
는 과 사이의 숫자입니다 5
.