赞美太阳啊 发表于 2025-1-25 11:43

还是gamelist.xml编辑的小问题,求助

本帖最后由 赞美太阳啊 于 2025-1-25 11:45 编辑

https://bbs.saraba1st.com/2b/thread-2212289-1-1.html
之前在本区求助过坛友关于xml编辑过程中,用正表达式查找替换内容的方式,非常感谢包括版主和dccif等多位坛友帮助


在他们的帮助下,第一个FC游戏999合1的rom包我昨晚发在了游戏区,算是回馈有需要的坛友
https://bbs.saraba1st.com/2b/thread-2244112-1-1.html


不过在做第二弹SFC游戏800合1的时候遇到1个小问题。

我在当初20楼的坛友dccif给的正表达式修改xml的时候,会吧原本单独另起一行的<desc>内容变成跟<name>在同一行,大概就是这样:

现在的样子:


      <path>./[日]46 Okunen Monogatari-Harukanaru Eden.sfc</path>
      <name>46亿年物语遥远的伊甸[日]</name>                        <desc>The storyline of E.V.O.: Search for Eden follows the same patterns as modern Evolution theories. The players first controls a prehistoric sea organism, and fights to gain evolution points with which he can improve his fish's body parts and upgrade his attack/defense abilities. The gameplay is not completely linear, which means that certain choices of paths and stages will affect the player's success.The game is composed of a series of stages, in which the sea organism slowly evolves into an amphibian, and later a land-only creature. The physical changes are fairly scientifically accurate which gives the game a semi-educational purpose as well.</desc>

希望变成的样子:



      <path>./[日]46 Okunen Monogatari-Harukanaru Eden.sfc</path>
      <name>46亿年物语遥远的伊甸[日]</name>               
      <desc>The storyline of E.V.O.: Search for Eden follows the same patterns as modern Evolution theories. The players first controls a prehistoric sea organism, and fights to gain evolution points with which he can improve his fish's body parts and upgrade his attack/defense abilities. The gameplay is not completely linear, which means that certain choices of paths and stages will affect the player's success.The game is composed of a series of stages, in which the sea organism slowly evolves into an amphibian, and later a land-only creature. The physical changes are fairly scientifically accurate which gives the game a semi-educational purpose as well.</desc>



我知道这个并不影响xml的使用,其实也不算多大的问题,只是我有强迫症而已,附件我传到了论坛,还希望坛友能指点一下,我应该怎么操作,我现在用的编辑器是vscode,内嵌的AI我试过好几次,结果并不满意



=w= 发表于 2025-1-25 12:26

本帖最后由 =w= 于 2025-1-25 12:40 编辑

Ctrl + H

字符串1:
</name>\t\t<desc>

点右边的那个星号开启正则表达式(Alt+R)

字符串2:
</name>\n\t<desc>

试一下吧

编辑:你这个数不太对劲诶,path有800个,desc只有798个,怎么少了2个?

编辑2:找到了

514行

<name>不可思议的迷宫2风来的西林[日]</name>        </game>

7434行

<name>超级大航海时代[日]</name>        </game>

这2个少了简介描述

赞美太阳啊 发表于 2025-1-25 13:13

=w= 发表于 2025-1-25 12:26
Ctrl + H

字符串1:


非常感谢

赞美太阳啊 发表于 2025-1-25 13:25

=w= 发表于 2025-1-25 12:26
Ctrl + H

字符串1:


另外再请教一下,怎么快速排查这种缺漏?

=w= 发表于 2025-1-25 13:43

赞美太阳啊 发表于 2025-1-25 13:25
另外再请教一下,怎么快速排查这种缺漏?

经验或者是个人习惯吧
先确定里面有多少项目,就你的这个文件来说,每个项目必有<name>(或者<game>)所以可以得出项目数
一看替换的项目数跟这个项目数对不上就是少了或者是多了,剩下的就是慢慢调试了
</name>\t 能搜到800个,但是 </name>\t\t 却只有798个,最后的\t换成[^\t]即匹配非\t的其他字符,完整的表达式是 </name>\t[^\t] 就能搜到了

赞美太阳啊 发表于 2025-1-25 13:55

=w= 发表于 2025-1-25 13:43
经验或者是个人习惯吧
先确定里面有多少项目,就你的这个文件来说,每个项目必有(或者)所以可以得出项 ...

好的,谢谢你

精钢魔像 发表于 2025-1-25 14:06

花点时间学一下python和sqlite数据库好些,反正现在vscode都集成copilot了,免费,按下ctrl+i写需求ai就能帮写代码

格林达姆 发表于 2025-1-25 14:50

vscode那直接alt+shift+f是应该最快的
页: [1]
查看完整版本: 还是gamelist.xml编辑的小问题,求助