dxvyi1
新手上路
积分 17
发帖 10
注册 2007-5-8
状态 离线
|
『楼 主』:
如何删除文本中指定位置之后的文本
在做封闭系统时遇到难题。有这样一个文本(假设文件名为1.reg):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion]
"DevicePath"=hex(2):43,00,3a,00,5c,00,57,00,49,00,4e,00,44,00,4f,00,57,00,53,\
00,5c,00,69,00,6e,00,66,00,3b,00,63,00,3a,00,5c,00,64,00,72,00,69,00,76,00,\
65,00,72,00,73,00,00,00
"MediaPathUnexpanded"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,\
6f,00,6f,00,74,00,25,00,5c,00,4d,00,65,00,64,00,69,00,61,00,00,00
"SM_GamesName"="游戏"
"SM_ConfigureProgramsName"="设定程序访问和默认值"
我想只保留"MediaPathUnexpanded"=hex之前的内容,应该如何实现?最好不要用"MediaPathUnexpanded"=hex作为参照。
再如有个文本(假设文件名为2.txt):
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion
devicepath REG_EXPAND_SZ C:\WINDOWS\inf;c:\drivers
只保留“C:\WINDOWS\inf;c:\drivers”这段文字如何实现?
谢谢~~~
[ Last edited by dxvyi1 on 2007-5-8 at 02:21 PM ]
|
|