Board logo

标题: 请问这个文本怎么用批处理读取~! [打印本页]

作者: heyoug     时间: 2008-8-21 20:49    标题: 请问这个文本怎么用批处理读取~!

--------[ EVEREST Corporate Edition ]-----------------------------------------------------------------------------------

    版本                                              EVEREST v4.20.1170/cn
    主页                                              http://www.lavalys.com/
    报告类型                                          命令行
    计算机                                            HY20080821
    用户                                              Administrator
    操作系统                                          Microsoft Windows XP Professional 5.1.2600 (WinXP Retail)
    日期                                              2008-08-21
    时间                                              20:15


--------[ 摘要 ]--------------------------------------------------------------------------------------------------------

    计算机:
      计算机类型                                        Advanced Configuration and Power Interface (ACPI) PC
      操作系统                                          Microsoft Windows XP Professional
      操作系统 Service Pack 版本                        Service Pack 3
      Internet Explorer                                 6.0.2900.5512
      DirectX                                           4.09.00.0904 (DirectX 9.0c)
      计算机名称                                        HY20080821
      用户名称                                          Administrator
      登录域                                            20080821-1647
      日期/时间                                         2008-08-21 / 20:15

    主板:
      CPU 类型                                          Intel Celeron D, 2633 MHz
      主板名称                                          Microsoft Virtual Machine
      主板芯片组                                        Intel 82440BX/ZX
      系统内存                                          256 MB  (EDO)
      BIOS 类型                                         AMI (02/22/06)
      通讯端口                                          通讯端口 (COM1)
      通讯端口                                          通讯端口 (COM2)
      通讯端口                                          打印机端口 (LPT1)

    显示设备:
      显示卡                                            S3 Trio32/64  (4 MB)

    多媒体:
      声卡                                              Sound Blaster 16

    存储器:
      IDE 控制器                                        Intel(R) 82371AB/EB PCI Bus Master IDE Controller
      软盘驱动器                                        软盘驱动器
      磁盘驱动器                                        Virtual HD  (78 GB, IDE)
      光盘驱动器                                        MS C/DVD-ROM  (Virtual DVD-ROM)
      硬盘 SMART 状态                                   未知

    分区:
      C: (FAT32)                                        19977 MB (17765 MB 可用)
      D: (FAT32)                                        19992 MB (19454 MB 可用)
      E: (FAT32)                                        19992 MB (19992 MB 可用)
      F: (FAT32)                                        19992 MB (15896 MB 可用)
      总计容量                                          78.1 GB (71.4 GB 可用)

    输入:
      键盘                                              QuickOn Button
      鼠标                                              Microsoft PS/2 Mouse

    网络:
      主 IP 地址                                        192.168.1.251
      主 MAC 地址                                       00-03-FF-CC-E7-B2
      网卡                                              Intel 21140-Based PCI Fast Ethernet Adapter (Generic)  (192.168.1.251)

    DMI:
      DMI BIOS 供货商                                   American Megatrends Inc.
      DMI BIOS 版本                                     080002
      DMI 系统制造商                                    Microsoft Corporation
      DMI 系统产品                                      Virtual Machine
      DMI 系统版本                                      VS2005R2
      DMI 系统序列号                                    9569-1788-1256-8464-7640-6305-22
      DMI 系统 UUID                                     70B18BC5-F81B8C43-B5A30D4A-C1B435AB
      DMI 主板制造商                                    Microsoft Corporation
      DMI 主板产品                                      Virtual Machine
      DMI 主板版本                                      5.0
      DMI 主板序列号                                    9569-1788-1256-8464-7640-6305-22
      DMI 底盘制造商                                    Microsoft Corporation
      DMI 底盘版本                                      5.0
      DMI 底盘序号                                      9569-1788-1256-8464-7640-6305-22
      DMI 底盘识别标签                                  9569-1788-1256-8464-7640-6305-22
      DMI 底盘类型                                      Desktop Case
      DMI 内存插槽 (共计/空闲)                          4 / 0


------------------------------------------------------------------------------------------------------------------------

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

文本内容如上,读取其中的关键几行保存为另外的文本即可,(如CPU类型、显示卡、主IP地址。)
作者: lxmxn     时间: 2008-8-21 20:51
findstr /?
作者: huahua0919     时间: 2008-8-21 21:01

@ECHO OFF
for /f "delims=" %%i in ('findstr/i "cpu ip 显示卡" a.txt') do (
echo %%i >>c.txt
)
start "" c.txt

作者: heyoug     时间: 2008-8-21 21:08
谢谢回复,还没有成功。
作者: huahua0919     时间: 2008-8-21 21:13
不成功就是你的问题了,你前面的文件保存为a.txt.
然后在你的当前目录下建立我上面写的批处理.最后运行一下,看看能不能得到你要的结果
作者: heyoug     时间: 2008-8-21 21:17
犯了低级错误,谢谢了~!
作者: Batcher     时间: 2008-8-21 21:21

@echo off
findstr "CPU" a.txt
findstr "显示卡" a.txt
findstr "IP" a.txt

作者: pusofalse     时间: 2008-8-22 06:11
findstr /i "cpu ip 显示卡" a.txt>c.txt
start c.txt
每天都在用for,貌似都思维定向了呐。^_^