Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I don't know how to really work DOS but I really need help! I would need a bat file that can copy 1 specific line from each one of a number of txt files, and paste that line from every txt into a new final txt that would contain all of them. Could someone help me?
For example I have:
1.txt
a
b
c2.txt
a
b
cI need to have
3.txt
b
b(both b and b from files 1.txt and 2.txt.)
Thank you for your help!

Is the text you need to copy always going to be the same line or as the case of the example, the second line?

It is always going to be the same line but the numbers that follow the first word will change.
For example it could say
Totals: 123 456
but then it could change to
Totals: 675 456I need the entire "Totals:" line every time from every file.
But just that line. All of the other lines or text in the file are not necessary. If you need an example I could post one

Please see below an example:
Text1 contains:
## Analysis Log file ##Created:
Date : Monday, December 22, 2008
Time : 12:51:59
Version : XXXXNew Files:
Selected : 1Old Files:
Selected : 0
Starting analysis process....
File : xxxxFile Statistics:
Segments Words AP Words Total Percentage Char Count (Spaces) Char Count (No Spaces)
Replicated : 13 - 40 40 ( 2.0%) 292 265
100% matched : 30 35 - 35 ( 1.8%) 204 199
95% to 99% matched : 14 17 8 25 ( 1.3%) 148 138
85% to 94% matched : 14 0 223 223 ( 11.3%) 1291 1090
75% to 84% matched : 11 0 148 148 ( 7.5%) 851 717
50% to 74% matched : 0 0 0 0 ( 0.0%) 0 0
Untranslated : 218 - - 1503 ( 76.1%) 9725 8416
Totals : 300 52 419 1974 12511 10825Time taken to process file : 0 minutes, 24 seconds
From this file the only line I need is ---> Totals : 300 52 419 1974 12511 10825In some other text, this line's number will be different, but with the same structure, for example--->
Totals : 500 76 456 1234 45673 18695I need to isolate all these lines along with theri numbers in one new, different file.
Does this help? Thank you so much!!

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

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