Computing.Net > Forums > Disk Operating System > copy or move lines from text file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

copy or move lines from text file

Reply to Message Icon

Name: Sue
Date: January 16, 2002 at 18:36:10 Pacific
Comment:

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.




Sponsored Link
Ads by Google

Response Number 1
Name: David Peacock
Date: January 18, 2002 at 10:10:16 Pacific
Reply:

No.
There is a way round it of course

example 1

1.txt
abc

i want to copy bc to 2.txt

>edit 1.txt
Alt-File-SaveAs 2.txt
delete a and Save this file

Ok, 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 3

2.txt
line a
line b
line c

and 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.txt

i 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!


0

Response Number 2
Name: Laurence
Date: January 19, 2002 at 09:01:31 Pacific
Reply:

That's what the find filter is for.
http://users.cybercity.dk/~bse26236/batutil/help/FIND_S.HTM


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: copy or move lines from text file

copy or move and rename files www.computing.net/answers/dos/copy-or-move-and-rename-files/13772.html

read first line from text file www.computing.net/answers/dos/read-first-line-from-text-file/15066.html

extract n last line from text file www.computing.net/answers/dos/extract-n-last-line-from-text-file/13852.html