Jump to content
UBot Underground

How I'm Saving And Loading Project Data Without Tables... Good Idea?


Recommended Posts

Hi guys,

 

I just wanted to share how I'm saving and loading project data without using tables. I'm not sure if this is a good idea or not. There might be a better way. But I found this easy for me, because it's easy to read the information visually, and I don't really like using tables.

 

Specifying location by column, row is a bit hard for me to visualize when using tables. I like how Python uses dictionaries which ties elements to keys instead, so I think this concept is similar.

 

Perhaps someone here might find this useful. :) Or perhaps you could give me some tips on doing it better...

 

==========

Saving Data

==========

 

When saving data, I save it as an HTML file. And I save it in a format that's easily readable. Something like this:

 

<p><b>Date:<b> August 32nd, 2012</p>

 

<p><b>Variable 2:<b> This is the variable</p>

 

etc.

 

 

===========

Loading Data

===========

 

When loading data, I use regular expressions to grab all the necessary variables by specifying the item they're next to. 

 

For example, if I wanted to load the variable 'Date', I select and open up the HTML file.

 

And then I set the variable 'the_date' to a 'find regular expression' using something like this to grab the date:

 

(?<=<p><b>Date:</b> ).*?(?=</p>)

 

And voila!

 

===========

 

Well, like I said, I'm not so sure if this is a good idea or not. But that's how I'm doing it at the moment. Mainly because I like the way the data is represented. What do you think?

 

 

Link to post
Share on other sites

Why not... if you are that comfortable with regex I dont see why this is not a good idea... I personally use a database most of the time, but for settings files and such I often use an XML file and the xml plugin from aymen.  But, I hate regex so, I avoid it like the plague:)

Link to post
Share on other sites

Why not... if you are that comfortable with regex I dont see why this is not a good idea... I personally use a database most of the time, but for settings files and such I often use an XML file and the xml plugin from aymen.  But, I hate regex so, I avoid it like the plague:)

 

Ok. :) Well, I wasn't sure if there were any speed or memory issues doing it like this.... but I guess it should be ok then. :)

 

I see. I have no idea how to use a database. Will learn it soon. :) Just had a look at the XML plugin. Looks pretty cool!

 

Regex is a bit tricky, but it's really fun and easy to use once you get the hang of it. :D

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...