Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Can a batch file be made to copy or move certain lines from a text file to a different file? I know I can use test.bat >>text1.bat, but I don't need all of the information I am retrieving.

No.
There is a way round it of courseexample 1
1.txt
abci want to copy bc to 2.txt
>edit 1.txt
Alt-File-SaveAs 2.txt
delete a and Save this fileOk, so that was a bit easy, but can you see how you could extend it.
Now, what i think you're after is this
1.txt
line 1
line 2
line 32.txt
line a
line b
line cand what i want to do is to transfer line b from 2.txt to 1.txt
Not so easy
>copy 1.txt+2.txt 3.txt
>edit 3.txt
>rem remove anything you don't want and then save it
>del 1.txt
>ren 3.txt 1.txti think you can also use file compare fc.exe, which will print the differences between two text files. i don't know if you can pipe this difference to a thid file.
i am thinking, i don't quite know how to do it, but you are supposed to be able to run more than one version of an msdos program, so you should be able to run two versions of edit.com. If so, you can use the dos clipboard, and then switch between files. I have never tried this, but it should work. So its Alt-Edit copy/paste, then Alt+Tab to switch.
Thank God for Windows ay!

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |