Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I'm trying to write a simple DOS *.cmd file that would search for a line that has a specific word in a text file, then copies that line and 30 lines after it to a new text file, The Original text file may contain multiple instances of the word of interest and I want all of these copied to the new file.Any help, any one??
Thanks

look at the below sample of file input, and say you are looking for "myword"
this is a line myword here this is next line another myword here this is another next line blahthere are 2 "mywords", so will there be 2 files each ? one will contain
myword here this is next line another myword here this is another next line blahand the other file will contain
another myword here this is another next line blahbetter explain clearly your requirement.

Thanks for the response:
I found a way to do what I want using a macro within my text editor.
Thanks

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |