标题: [文本处理] 求思路:批处理提取指定位置的数据 [打印本页]
作者: dailyad 时间: 2020-7-29 10:20 标题: 求思路:批处理提取指定位置的数据
如下,需要提取标红的数据为B列,并以文件名位A列,存为CSV。求大神给一个思路‘、
数据一般在固定行,第10行,第二个数据’- 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 [color=Red]-11.7 [/color] 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.
复制代码
复制代码
作者: dailyad 时间: 2020-7-29 10:20
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.
作者: Batcher 时间: 2020-7-29 13:13
回复 1# dailyad - @echo off
- set "SrtFile=1.txt"
- set "DstFile=1.csv"
- cd /d "%~dp0"
- >"%DstFile%" echo A,B
- for /f "skip=10 tokens=2" %%i in ('type "%SrtFile%"') do (
- >>"%DstFile%" echo %SrtFile%,%%i
- goto :eof
- )
复制代码
作者: dailyad 时间: 2020-7-29 19:49
回复 3# Batcher
:handshake
:handshake
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |