Extracting data from a text file

dash666

New Member
Joined
Mar 16, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Can someone help me on this please?

I have exported a control system data into a text file. now I have this file with huge blocks of data. they have similar structure, but inside the block some have more data lines (the start and end is similar).
below is portion of one section.
Each section starts with "Batch_RECIPE Name" I want to search each section for items that I high-lighted in Blue and then it gives me the results that are in Green.

All sections have the first line, but they wary on the number of line after them. so some of those results would be blank

results need to be in an excel row for each section. 1st Green would be in cell A1 and then 2nd Green would be in B1, C1, D1, etc.

A1=OP_ALUM_BH_SUPPLY
B1= ENUMERATION_VALUE

C1= BATCH_PARAMETER_INTEGER

and then the it goes to the next block and next block could have result just for cells A1 and B1 so C1 would be just black


My source file data (there are more than 300 of these "blocks" and I only posted section of first one, but they all are similar:

BATCH_RECIPE NAME="OP_ALUM_BH_SUPPLY" TYPE=OPERATION CATEGORY="Recipes/Operations/Alum_Skid"

{
DESCRIPTION="Alum Buffer Hold Tank Supply"
USE_EQUIPMENT_TRAINS=F
EQUIPMENT_UNIT_CLASS="ALUM_BUFF_HOLD_UC"
ENFORCED_FORMULA_SELECTION_ENABLED=F
DEFAULT_SELECTED_FORMULA=""
PARAMETERS_LOCKED_BY_DEFAULT=F
ABSTRACT="Alum Buffer Hold Tank Supply operation"
BATCH_UNITS="gal"
BATCH_LENGTH="1"
DEFAULT_BATCH_SIZE=1
MINIMUM_BATCH_SIZE=1
MAXIMUM_BATCH_SIZE=10
PRODUCT_CODE="ALUM"
PRODUCT_NAME="Alum Buffer Hold"
FORMULA_PARAMETER NAME="O_OUT_RES01" TYPE=UNICODE_STRING
{
CONNECTION=INPUT
RECTANGLE= { X=-50 Y=-50 H=1 W=1 }
IS_PARAMETER_LOCKED=F
}
FORMULA_PARAMETER NAME="O_AGIT_ACTIVATE" TYPE=ENUMERATION_VALUE
{
CONNECTION=INPUT
RECTANGLE= { X=-50 Y=-50 H=1 W=1 }
IS_PARAMETER_LOCKED=F
}
FORMULA_PARAMETER NAME="O_AGIT_FINAL_ST" TYPE=ENUMERATION_VALUE
{
CONNECTION=INPUT
RECTANGLE= { X=-50 Y=-50 H=1 W=1 }
IS_PARAMETER_LOCKED=F
}
FORMULA_PARAMETER NAME="O_AGIT_MIX_TM" TYPE=BATCH_PARAMETER_INTEGER
{
CONNECTION=INPUT
RECTANGLE= { X=-50 Y=-50 H=1 W=1 }
IS_PARAMETER_LOCKED=F
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:
VBA to extract specific data from text file

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:
VBA to extract specific data from text file

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
but would you be able to help?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top