Extracting data from .ini files

Rampage123

New Member
Joined
Apr 19, 2020
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

I am trying to import data from .ini files with Power Query on Excel 2016, These files will contain various information that I do not want. I only want the values that are below a certain heading [Calpoints] and above a certain heading [Lower]. The amount of values will vary but the Headings will always be there and will be exactly the same. This is what a file would contain:

File name: 1A.ini

[General]
CalType=Instantaneous
CTRatio=Direct: 6A
NetAddr=1
[Polynomial]
Degree=2
2=0.639087543667983
1=2.05102538315623
0=-12.019992726895
[CalPoints]
4.006=6.1789
4.967=14.5015
6.282=25.9087

[Lower]
ZeroFlowKW=2
MinKW=2

.....other data etc

The bold values corresponds to kW and m3/h so they will also have to be seperated by the equal sign

So my end goal would be to get the data in bold on a spreadsheet in a table as such automatically so i can just drop new files into the folder:

SiteDate created(from file)kW 1kW 2kW 3m3/h 1m3/h 2m3/h 3
1Adate of file created4.0064.9676.2826.178914.501525.9087

I am only looking for some guidance as to what I will need to learn to achieve this and where I should start...

What I am struggling with is getting only the exact data from the .ini file. Should a script be written to first edit these files(don't know how to yet) or is this possible in power query directly?

Any help or tips will be appreciated

Thanks,
Richardt
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
is that what you want?
you can remove unnecessary columns
ini.png
 
Upvote 0

Forum statistics

Threads
1,223,794
Messages
6,174,641
Members
452,575
Latest member
Fstick546

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