|
dy2003310
初级用户
 
积分 180
发帖 68
注册 2006-12-21 来自 China
状态 离线
|
『第 16 楼』:
请教楼上各位兄弟
使用 LLM 解释/回答一下
合并了1000或更多行以后,怎样将它们变成原来一行行的样子??
for /f "delims=;????" %i in (合并后.txt) do echo ????? >新的.txt
?????
After merging 1000 or more lines, how to turn them back into the original individual lines??
for /f "delims=;????" %i in (merged.txt) do echo ????? >new.txt
?????
|
|
2007-2-4 02:09 |
|
|
jmz573515
银牌会员
    
积分 1212
发帖 464
注册 2006-12-13
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
16楼的兄弟,用VBS写的,请确保源文件中没有“;”符号。
set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("b.txt")
s=file.readall
file.close
set file=fso.createtextfile("c.txt")
file.write replace(s,";",vbcrlf)
file.close
msgbox "还原成功",4096
Brother on floor 16, written with VBS, please make sure there are no ";" symbols in the source file.
set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("b.txt")
s=file.readall
file.close
set file=fso.createtextfile("c.txt")
file.write replace(s,";",vbcrlf)
file.close
msgbox "Restore successful",4096
|
|
2007-2-4 03:35 |
|
|
dy2003310
初级用户
 
积分 180
发帖 68
注册 2006-12-21 来自 China
状态 离线
|
『第 18 楼』:
谢谢jmz573515
使用 LLM 解释/回答一下
先谢谢兄弟了
可痛苦的是我按上面各路高手合并后得到的恰恰有";"
First, thank you, brother. But the painful thing is that what I got after merging according to the methods of various experts above actually has ";"
|
|
2007-2-4 08:34 |
|
|
dy2003310
初级用户
 
积分 180
发帖 68
注册 2006-12-21 来自 China
状态 离线
|
『第 19 楼』:
噢,我搞错了,jmz573515兄,我刚才有点误解了你的意思
使用 LLM 解释/回答一下
噢,
我搞错了,
jmz573515兄,
我刚才有点误解了你的意思
现在我按你的做法收到了如意的效果
再次谢谢
Oh,
I made a mistake,
Brother jmz573515,
I had a little misunderstanding of your meaning just now
Now I have achieved the desired effect according to your method
Thank you again
|
|
2007-2-4 08:51 |
|
|
amao
中级用户
  
积分 316
发帖 152
注册 2006-6-18
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
sed "s/ ;/\n/g" 合并成一行的.txt> 输出结果单行的.txt
sed "s/ ;/\n/g" 合并成一行的.txt> 输出结果单行的.txt
sed "s/ ;/\n/g" merged_into_one_line.txt> output_single_line.txt
|
|
2007-2-4 17:33 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
Originally posted by amao at 2007-2-4 17:33:
sed "s/ ;/\n/g" 合并成一行的.txt> 输出结果单行的.txt
看不出是怎么实现的
Originally posted by amao at 2007-2-4 17:33:
sed "s/ ;/\n/g" 合并成一行的.txt> 输出结果单行的.txt
Can't see how it is implemented
|
|
2007-2-4 18:02 |
|
|
amao
中级用户
  
积分 316
发帖 152
注册 2006-6-18
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
Originally posted by vkill at 2007-2-4 18:02:
看不出是怎么实现的
你把我前面合并的和这个拆分的执行一下就知道了。
Originally posted by vkill at 2007-2-4 18:02:
Can't see how it's implemented
You can execute the one I merged earlier and this split one to find out.
|
|
2007-2-4 21:58 |
|
|
dy2003310
初级用户
 
积分 180
发帖 68
注册 2006-12-21 来自 China
状态 离线
|
『第 23 楼』:
amao兄
使用 LLM 解释/回答一下
Originally posted by amao at 2007-2-4 04:33 AM:
sed "s/ ;/\n/g" 合并成一行的.txt> 输出结果单行的.txt
amao兄,怎么我的cmd说"sed"不是内外部命令呀??
暂时看不到希望的结果
请问amao兄的语句是保存成什么文件来执行的??
Originally posted by amao at 2007-2-4 04:33 AM:
sed "s/ ;/\n/g" 合并成一行的.txt> 输出结果单行的.txt
Brother amao, why does my cmd say that "sed" is not an internal or external command??
I can't see the expected result for the time being
May I ask, Brother amao, what kind of file is the statement saved as to be executed??
|
|
2007-2-5 00:59 |
|
|
amao
中级用户
  
积分 316
发帖 152
注册 2006-6-18
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
RE dy2003310
sed 不是xp的内部命令
请搜索相关帖子,关键字sed
把语句保存成.bat批处理即可执行,当然要把 “合并成一行的.txt, 输出结果单行的.txt ”等改成相应的名字
RE dy2003310
sed is not an internal command of XP
Please search related posts with the keyword sed
Save the statement as a .bat batch file to execute. Of course, change "merged into one line.txt, output result single line.txt" and so on to corresponding names
|
|
2007-2-5 02:24 |
|
|
lbqldos
新手上路

积分 16
发帖 7
注册 2007-2-2
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
Originally posted by 3742668 at 2006-7-19 09:39 AM:
在批处理的实际应用中,建议不要使用太多的变量。
for /f "delims=" %i in (源文件.txt) do @set /p "var=%i;" <nul >>目标文件.txt
用 set/p “变量=显示内容”<nul 代替echo 显示内容,输出不自动换行,精彩,想不到set还可以这样用:D
Last edited by lbqldos on 2007-2-4 at 02:43 PM ]
Originally posted by 3742668 at 2006-7-19 09:39 AM:
In practical applications of batch processing, it is recommended not to use too many variables.
for /f "delims=" %i in (source file.txt) do @set /p "var=%i;" <nul >>target file.txt
Using set /p "variable=display content" <nul to replace echo display content, the output does not automatically wrap lines. Wonderful, I didn't expect set can be used like this :D
Last edited by lbqldos on 2007-2-4 at 02:43 PM ]
|
|
2007-2-5 03:41 |
|
|
dy2003310
初级用户
 
积分 180
发帖 68
注册 2006-12-21 来自 China
状态 离线
|
『第 26 楼』:
谢谢 amao兄
使用 LLM 解释/回答一下
谢谢 amao兄
正在学习
Thanks, Brother amao
I'm studying
|
|
2007-2-7 07:12 |
|