Jump to content

[SOLVED] Parsing out a file using special characters


johng

Recommended Posts

I am creating a site where someone would enter data into a few text boxes, with the potential for them to be fairly long.  I am therefore saving them into a text file instead of a database. 

 

With these, there is a potential for someone to use the enter key in these boxes, therefore making it very difficult to just parse it out by line. 

 

I am currently trying to figure out how to parse it by special characters (or groups of characters such as "%%$$%%" or something that noone would ever type, on purpose or by accident) 

 

I was wondering if there was a way to parse this out by these special characters, or if there was a way to save those line returns that the people enter as something other than a line return.

 

Any ideas? (or questions?)

I would use a database instead of a text file. A ton easier to work with. You do not have to use Varchar(250) which limits it to 250 characters you can use a TEXT field which can take a ton of data.

 

That way there is no messy parsing. My 2 cents.

Will it slow down the database if there is a lot of data there?

The amount of data for these fields is going to be paragraphs, not just a sentance or two.  I didn't know if there would be the potential for too much data for a text field in a db.

What do you mean by regular expressions?

 

I'll try to clarify what I'm after:

 

I'm creating a page where people will enter quite a bit of data.  It has some questions that will have a fairly large place to enter text, with the potential for paragraphs of description.  I'm hesitant to put this into a database, because I'm afraid it will slow the database way down.  So I decided to put these fields into a text file.  But when they enter the data, they have the option to use the "enter" key, which prevents me from being able to just look up the different fields by line.  I'm trying to use some special characters, but I'm not sure how to parse out the file using those characters as a stop for the length of the field, like you would do with a new line. 

 

Hopefully that is a little more clear, if not, I'll try again. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.