Find Values in Text File after user specified string

jherget

New Member
Joined
Jun 2, 2016
Messages
1
Hi Guys,

I'm having trouble finding the best way to extract data from a text file. Below is an example of the text:



09-27 +0.81
12-12 +0.56
02-16 +0.19
03-01 +0.02
LO
HI
L3213141 X 22 Y= 44 Z 66
Mean Range 6 Sigma Samples
+0.2 0.1 +11 19
I= 0.056 J 0.533 K 0.813 F FLUSHNESS

Basically the program I need to write has to ask the user to specify what point they are interested in (in this case L3213141). From there I need to extract the values for X,Y,Z and I,J,K and output to an excel worksheet. The position is not always the same in each text file for these values but they do always come somewhere after the name of the point (L3213141). Any help would be appreciated!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Jherget,
is that the complete text file or are there more lines to it? Looking for your six values, I see "I=", "Y=" and the other letters without an "=" behind them, is that formatting always the same? And are X,Y and Z always on the same line? And I,J and K? Basically, to write some decent code, it's practical to know whether the values are just randomly anywhere in your text or if there is some logic to it. And if you have some code, please do post it here (in [ CODE ] brackets).
Thanks,
Koen
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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