Open and parse through file

Open and parse through file

  
I have a log file. What I want to do I is to upload it. Then I have an action that starts to parse through the file, and will save certain things into the database.
So I have an upload widget. I have a screen action called "Upload". What I want to do is to be able to program using some language inside of the file contents and hopefully have certain built-in functions (like querying, as well as saving to the database) that I can work with
Hi Kevin

I can't say that I fully understand what you mean by "program using some language inside of the file contents".

Do you want to parse the file and load it's data to the database or parse the file and evaluate the file contents as if it was a script? can you elaborate?

For parsing file example, check out the post for an XML file: http://www.outsystems.com/forums/discussion/9959/parsing-xml-with-name-value-pairs-as-attributes/

Cheers

Miguel Simoes Joao
Miguel João wrote:
Hi Kevin

I can't say that I fully understand what you mean by "program using some language inside of the file contents".

Do you want to parse the file and load it's data to the database or parse the file and evaluate the file contents as if it was a script? can you elaborate?

For parsing file example, check out the post for an XML file: http://www.outsystems.com/forums/discussion/9959/parsing-xml-with-name-value-pairs-as-attributes/

Cheers

Miguel Simoes Joao
 
 I mean programming with the contents of the file with something like c++, ruby, etc. I'll probably have to use regex or something else 
"Do you want to parse the file and load it's data to the database or parse the file and evaluate the file contents as if it was a script?"
i think this is accurate in what i need, I need to search through the file loading some sections to my database
Hi Kevin

To load some sections to the database, checkout the link I've posted previously. Although it uses XML actions to get the relevant data and store on the database, you can extrapolate to using the Regex (use the Text extension) to get the relevant data and store it on the database.

If you need to actually to compile and execute code or script, you'll need to actually run processes to compile and/or run the uploaded file. For this, you can use the Process Extension. Keep in mind that you might need to have your application running with higher privileges using the Run As setting.

Hope it helps.

Cheers

Miguel Simões João
Hi Kevin,

Adding to the previous answer, you can also write a extension using Integration Studio.
Your action would recieve the file content as input and process it, returning a list of processed information.
Using integration studio you can write your custom code in c# (or java if using a java version of the platform).

Regards,
João Rosado