[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 求思路:批处理提取指定位置的数据

如下,需要提取标红的数据为B列,并以文件名位A列,存为CSV。求大神给一个思路‘、
数据一般在固定行,第10行,第二个数据’
  1. Reading input ... done.
  2. Setting up the scoring function ... done.
  3. Analyzing the binding site ... done.
  4. Using random seed: -1077514464
  5. Performing search ... done.
  6. Refining results ... done.
  7. mode |   affinity | dist from best mode
  8.      | (kcal/mol) | rmsd l.b.| rmsd u.b.
  9. -----+------------+----------+----------
  10.    1        [color=Red]-11.7 [/color]     0.000      0.000
  11.    2        -11.4      3.334      6.584
  12.    3        -11.4      4.283      6.896
  13.    4        -11.2      1.316      3.968
  14. Writing output ... done.
复制代码
  1. A            B
  2. 文件名    -11.7
复制代码

回复 3# Batcher


:handshake
   
:handshake

TOP

回复 1# dailyad
  1. @echo off
  2. set "SrtFile=1.txt"
  3. set "DstFile=1.csv"
  4. cd /d "%~dp0"
  5. >"%DstFile%" echo A,B
  6. for /f "skip=10 tokens=2" %%i in ('type "%SrtFile%"') do (
  7.     >>"%DstFile%" echo %SrtFile%,%%i
  8.     goto :eof
  9. )
复制代码
1

评分人数

我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

Reading input ... done.
Setting up the scoring function ... done.
Analyzing the binding site ... done.
Using random seed: -1077514464
Performing search ... done.
Refining results ... done.

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
   1        -11.7      0.000      0.000
   2        -11.4      3.334      6.584
   3        -11.4      4.283      6.896
   4        -11.2      1.316      3.968
Writing output ... done.

TOP

返回列表