Moving data to procedure and text manip
Posted: Thu Mar 09, 2006 1:53 am
I need a way to read data from a file and to pass it to a few procedures for treatments.
I want to do some 'search and replace' for multiples items at the same time.
I want to remove/replace multiple HTML tags in a document.
I have already a procedure made by Droopy to "construct" the string to be removed. It worked well for a simple string variable but i need to apply the procedure to a whole document. I've tried to read the document to a linked list but i'm not able to pass that list to the procedure.
Here's the procedure from the Tips 'n Tricks section:
http://www.purebasic.fr/english/viewtopic.php?t=18665
I will probably have at least another procedure to do the string replacements also.
The size of these documents should never exceed 1024Kb for most of the time.
What would be the best way to read the data in memory?? Should i allocate memory... use a linked list??
How can i pass lots of data to/from a procedure??
For now, the program is only able to process one tag at a time. My goal is to call a 'search/replace' procedure multiple times using a different tag as an argument each time. Is it an effective way to do this??
If been thinking about regexp implementation also... but i haven't look for it yet.
Thanks in advance!!!
I want to do some 'search and replace' for multiples items at the same time.
I want to remove/replace multiple HTML tags in a document.
I have already a procedure made by Droopy to "construct" the string to be removed. It worked well for a simple string variable but i need to apply the procedure to a whole document. I've tried to read the document to a linked list but i'm not able to pass that list to the procedure.
Here's the procedure from the Tips 'n Tricks section:
http://www.purebasic.fr/english/viewtopic.php?t=18665
I will probably have at least another procedure to do the string replacements also.
The size of these documents should never exceed 1024Kb for most of the time.
What would be the best way to read the data in memory?? Should i allocate memory... use a linked list??
How can i pass lots of data to/from a procedure??
For now, the program is only able to process one tag at a time. My goal is to call a 'search/replace' procedure multiple times using a different tag as an argument each time. Is it an effective way to do this??
If been thinking about regexp implementation also... but i haven't look for it yet.
Thanks in advance!!!