Board logo

标题: [文本处理] 批处理如何把txt按照每行分成多个TXT? [打印本页]

作者: 修修的想法    时间: 2018-7-17 15:27     标题: 批处理如何把txt按照每行分成多个TXT?

一个txt按照每行分成多个TXT 每个TXT名字按照 链接前的名字命名不要后缀名
txt内容为此行内容 内有 链接
文本文件 测试
作者: 修修的想法    时间: 2018-7-17 15:28

测试文件
作者: Batcher    时间: 2018-7-17 15:29

把txt文件压缩之后传上来看看
作者: 修修的想法    时间: 2018-7-17 15:29

06编辑特效-41镜头边缘暗角_高清.mp4: https://xiaoguotu.ctfile.com/fs/1366871-295445544
06编辑特效-42体积云_高清.mp4: https://xiaoguotu.ctfile.com/fs/1366871-295445556
06编辑特效-43水彩风格_高清.mp4: https://xiaoguotu.ctfile.com/fs/1366871-295445553
06编辑特效-44隐藏和显示图层_高清.mp4: https://xiaoguotu.ctfile.com/fs/1366871-295445545

文本内容是这样
作者: Batcher    时间: 2018-7-17 15:47

  1. @echo off
  2. for /f "tokens=1,* delims=:" %%i in ('type "1.txt"') do (
  3.     >"%%~ni.txt" echo %%j
  4. )
复制代码

作者: 修修的想法    时间: 2018-7-17 16:11

感谢大神 已解决  
现在想在生成txt 的基础上打包压缩 可以么?
作者: 修修的想法    时间: 2018-7-17 16:12

Batcher 发表于 2018-7-17 15:47

希望做成压缩格式 rar 能否实现  感谢
作者: Batcher    时间: 2018-7-17 16:36

回复 7# 修修的想法
  1. @echo off
  2. for /f "tokens=1,* delims=:" %%i in ('type "1.txt"') do (
  3.     >"%%~ni.txt" echo %%j
  4.     "C:\Program Files\WinRAR\WinRAR.exe" a -ibck "%%~ni.rar" "%%~ni.txt"
  5. )
复制代码

作者: Batcher    时间: 2018-7-17 16:41

压缩之后删除txt
  1. @echo off
  2. for /f "tokens=1,* delims=:" %%i in ('type "1.txt"') do (
  3.     >"%%~ni.txt" echo %%j
  4.     "C:\Program Files\WinRAR\WinRAR.exe" a -ibck -df "%%~ni.rar" "%%~ni.txt"
  5. )
复制代码

作者: 修修的想法    时间: 2018-7-18 08:50

压缩之后删除txt
Batcher 发表于 2018-7-17 16:41



    大神能不能批量公开分享百度云文件?
作者: 修修的想法    时间: 2018-7-18 09:43

回复 9# Batcher
大神 能不能批量分享呀




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2