zoukankan      html  css  js  c++  java
  • 批处理 获取某个文件的,特定 两列,可以修改用来做相关的操作

    贴出 批处理 代码:

    SCHTASKS /Create /SC DAILY /TN hibernate_pc /TR "shutdown /h" /ST 22:00

    @echo off & cls
    
    title The batch file is in order to locate specified row and column By Frank V1.1
    color 1f
    mode con cols=115 lines=25
    rem 设置变量延迟
    setlocal enabledelayedexpansion
    
    rem 输入参数模块
    set /p fieldDelim=Please enter field delimeters: 
    set /p fileName=Please enter the file(qulified name) which you want: 
    set /p specifiedColumnOrder=Please enter the specified column1 number you want to take: 
    set /p specifiedColumnOrder2=Please enter the specified column2 number you want to take: 
    set /p readOutputFileName=Please enter the output file qulified name
    
    
    rem 接收传入参数模块
    set fieldDel=!fieldDelim!
    set /a specifiedColumnOrd=%specifiedColumnOrder%
    set /a specifiedColumnOrd2=%specifiedColumnOrder2%
    set fileNam=!fileName!
    set readOutputFile=!readOutputFileName!
    
    
    ::读取第一行表头的俩 field 以及 指定行的 俩 field ,提示 Missing Operator 的问题没找到原因
    for /f "delims=^%fieldDel% tokens=%specifiedColumnOrd%,%specifiedColumnOrd2%" %%i in (%fileNam%) do echo ^%fieldDel%%%i^%fieldDel%^%fieldDel%%%j^%fieldDel%>>%readOutputFile%
    
    type %readOutputFile%
    pause>nul
    

      

    如果有来生,一个人去远行,看不同的风景,感受生命的活力。。。
  • 相关阅读:
    空格转换
    vuex学习
    css移动端适配方法
    数组以及数组常用方法
    21-canvas事件监听
    20-canvas之形变
    [转]session 跨域共享方案
    [转载] 从mysql,代码,服务器三个方面看mysql性能优化
    [计算机]Alan Perlis人物简介
    Python环境搭建及pip的使用
  • 原文地址:https://www.cnblogs.com/Frank99/p/5695926.html
Copyright © 2011-2022 走看看