本帖最后由 test 于 2012-11-25 21:39 编辑
第一个:- @echo off
- cd.>AA.txt
- for %%i in (*.003) do (
- echo %%~ni>>AA.txt
- copy /b AA.txt+%%i AA.txt>nul
- )
- start AA.txt
复制代码 第二个:
在6字开头的股票代码前添加SH字符串,其他的股票代码前添加SZ- @echo off
- setlocal enabledelayedexpansion
- (for %%i in (*.003) do (
- set "str1=%%~ni "
- if "!str1:~0,1!"=="6" (
- set str1=SH!str1!
- ) else set str1=SZ!str1!
- set num=0
- for /f %%j in (%%i) do (
- set str2=%%j
- if !num! equ 1 (
- if not "!str2:~0,3!"=="───" set str1=!str1!%%j,
- )
- if "!str2:~0,3!"=="───" set /a num+=1
- )
- if defined str1 echo !str1:~0,-1!;
- ))>NEW.txt
- start NEW.txt
复制代码
|