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

February 13, 2012 at 08:50:39
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.


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

Report •

#1
March 29, 2012 at 07:56:09
This one really feels like i have seen it under another user name? Is it by chance a textbook question?

mike


Report •
Related Solutions


Ask Question