Batch Script to Read Line by line of text and export.

Score
0
Vote Up
February 13, 2012 at 08:50:39 Pacific
Specs: Windows XP

Hi,

I have a large text file, how I write a batch script to read line by line and when it find certain words it will export the whole line in a file.

For example I have big.txt which includes in it:

Customet Name: Bla1
Part Number: Bla1
Date of Purchase: Bla1
Billing: Bla1

Customet Name: Bla2
Part Number: Bla2
Date of Purchase: Bla2
Billing: Bla1

Customet Name: Bla3
Part Number: Bla3
Date of Purchase: Bla3
Billing: Bla3

So on......its a large file like this.

I want a script that withh read each line and only when it finds a string "Customet Name: and "Part Number::" put them in a out.text file like this:

Customet Name: Bla1
Part Number: Bla1

Customet Name: Bla2
Part Number: Bla2

Customet Name: Bla3
Part Number: Bla3

Thank you.


Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
March 29, 2012 at 07:56:09 Pacific

This one really feels like i have seen it under another user name? Is it by chance a textbook question?

mike


Reply ↓  Report •
Reply to Message Icon Start New Discussion
Related Posts

« What is a M4404 code in g... Delete last line in txt f... »