Inifile without [sections]?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Inifile without [sections]?

Post by rullbandspelare » Mon Dec 26, 2005 1:27 pm

Hi!
I have a file that i would liket to use with ReadIni, but the problem is that it does not have any [section] part. It is a plain file with a lot of X=Thisandthat.

Is there a way to use ReadIni on a file like this. Or do i have to add a [data] line at the top of it first?

Thanks!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 26, 2005 1:48 pm

Hi,

To use ReadIniFile the file would need a [section] line. While you could use ReadLn and parse the data it sounds like it would be an awful lot easier just to add the [section] line to make it a regular ini file and then you can more easily use ReadIniFile. You could add the [section] line automatically to the top of the file using WriteLn. Or just do it manually if it's a once off process.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts