中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-11-11 04:57
47,815 topics / 349,930 posts / today 0 new / 48,291 members
DOS批处理 & 脚本技术(批处理室) » Extract the characters (files) before the first TAB position in each line of the text and copy them
Printable Version  2,662 / 29
Floor16 duanml Posted 2007-06-20 21:12
中级用户 Posts 112 Credits 231
Do you have UltraEdit installed?

First, copy the mixed directory files and attribute times in, and replace the space segments used to separate the contents with <tab> characters.

Then copy the content into Excel, and Excel will place the directory files and attribute times in different columns according to the <tab> delimiter.

Then add an empty column in front of the directory file column, insert xcopy, and replace the column after the directory file column with the target directory and /e.

After that, copy them all into a bat file together.
Floor17 beyoungse Posted 2007-06-20 21:13
中级用户 Posts 112 Credits 253
I'll try installing UltraEdit. Thanks for your attention
Floor18 lxmxn Posted 2007-06-20 21:49
版主 Posts 4,938 Credits 11,386
I followed the file you provided for testing and it works. I don't know why you can't.
Floor19 beyoungse Posted 2007-06-20 21:52
中级用户 Posts 112 Credits 253
Generated run.bat
copy "C:\Documents and Settings\All Users\「Start」Menu\Programs\Adobe ImageReady CS.lnk 1KB A 2007-6-20 19:19:52 " "D:\Documents and Settings\All Users\「Start」Menu\Programs\Adobe ImageReady CS.lnk 1KB A 2007-6-20 19:19:52 "
copy "C:\Documents and Settings\All Users\「Start」Menu\Programs\Adobe Photoshop CS.lnk 1KB A 2007-6-20 19:19:52 " "D:\Documents and Settings\All Users\「Start」Menu\Programs\Adobe Photoshop CS.lnk 1KB A 2007-6-20 19:19:52 "
copy "C:\Documents and Settings\All Users\「Start」Menu\Programs\Startup\Adobe Gamma Loader.lnk 2KB A 2007-6-20 19:19:52
.
.
.
..
Floor20 beyoungse Posted 2007-06-20 21:54
中级用户 Posts 112 Credits 253
I need to add quotes to the values in each cell in EXCEL. How can I add quotes to the values in a column?
Floor21 duanml Posted 2007-06-20 21:59
中级用户 Posts 112 Credits 231
Then add a column before and after the directory file list, add quotes in it, and then copy back to UltraEdit, use column mode to delete the excess <tab> symbols.
Floor22 beyoungse Posted 2007-06-20 22:06
中级用户 Posts 112 Credits 253
Well, I tried, but there are still some problems. When copying *.lnk, it prompts whether it's a file or a directory? You need to add \ after each directory.
Floor23 beyoungse Posted 2007-06-20 22:51
中级用户 Posts 112 Credits 253
It's okay to save the file as TXT using EXCEL, but there's still one problem. As follows:

xcopy /e "C:\Program Files\Common Files\InstallShield\Professional" "D:\Target Files\Program Files\Common Files\InstallShield\Professional"
xcopy /e "C:\Program Files\Common Files\InstallShield\Professional\RunTime" "D:\Target Files\Program Files\Common Files\InstallShield\Professional\RunTime"
xcopy /e "C:\Program Files\Common Files\InstallShield\Professional\RunTime\0701" "D:\Target Files\Program Files\Common Files\InstallShield\Professional\RunTime\0701"
xcopy /e "C:\Program Files\Common Files\InstallShield\Professional\RunTime\0701\Intel32" "D:\Target Files\Program Files\Common Files\InstallShield\Professional\RunTime\0701\Intel32"
xcopy /e "C:\Program Files\Common Files\InstallShield\Professional\RunTime\0701\Intel32\ctor.dll" "D:\Target Files\Program Files\Common Files\InstallShield\Professional\RunTime\0701\Intel32\ctor.dll"
xcopy /e "C:\Program Files\Common Files\InstallShield\Professional\RunTime\0701\Intel32\DotNetInstaller.exe" "D:\Target Files\Program Files\Common Files\InstallShield\Professional\RunTime\0701\Intel32\DotNetInstaller.exe"

When copying the first directory, it will copy all the files under the directory to the directory folder. When it's a directory, it's required to only create the directory, and when it's a file, it's only to copy the single file
Floor24 duanml Posted 2007-06-20 23:08
中级用户 Posts 112 Credits 231
There is a column in your file that shows attributes. When you first copy it into Excel, sort by attributes, pick out the D attribute and handle it separately from the file.

xcopy /t /e directory target
It won't copy the files.
Floor25 lxmxn Posted 2007-06-21 00:47
版主 Posts 4,938 Credits 11,386
Please upload your file as an attachment, and I'll test it.
Floor26 beyoungse Posted 2007-06-26 15:30
中级用户 Posts 112 Credits 253
I was occupied with other things the past two days, sorry. The original file is in the attachment.

Attachments
changefiles.txt (3.82 KiB)
Floor27 memphis220 Posted 2007-06-27 12:23
新手上路 Posts 3 Credits 6
for /f "usebackq delims== " %%i in (h:\cp.txt) do (mkdir e:\1"%%~pi")&(copy "%%i" e:\1"%%~pi")
Floor28 beyoungse Posted 2007-07-09 19:50
中级用户 Posts 112 Credits 253
There will still be redundant things upstairs. (mkdir "directory") & (copy "C:\"directory"\data1.cab 1,886KB A 2004-6-16 9:44:50" "directory")
Floor29 lxmxn Posted 2007-07-09 21:03
版主 Posts 4,938 Credits 11,386
RE beyoungse:

I tested again, the one on my 13th floor is okay, change yourfile.txt to your changfiles.txt file.
Floor30 beyoungse Posted 2007-07-09 22:17
中级用户 Posts 112 Credits 253
Thank you. I tested with XP XP2 and it works.

[ Last edited by beyoungse on 2007-7-9 at 10:28 PM ]
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023