Parse csv file
Need help (new in BonitaSW)... so
I need to read CSV file (delimited with ','), to:
* extract fields names and show them to a user;
* let user choose the field(s) name (and index?);
* convert/change the content of the chosen field;
* export it to another CSV/Excel etc with the same field order;
I can't find a way to read the CSV file :(
What I've done so far:
- contract with variable(s) (including variable 'fileObject' of type FILE );
- created some variables and a Document (called 'csvDocument');
- made the document 'csvDocument' as a 'fileObject';
- created instantiation form with 'UPLOAD' widget, formOutput returns and object Document ('fileObject' : $data.formInput.fileObject);
- created a Service Task to process the file (read content into memory) and then pass it as listFields of java.util.List) to another Human Task (to show form with field list)...
Is it possible to use those scripts in my project?
May be to use Operations I need to make it as Groovy script?
Any ideas? Any links to similar projects?
Appreciate your help!
Can you confirm my understanding:
- You want to allow a user to create a new CSV file.
- This new file will be based on an existing CSV file. The new file will includes only columns selected by the user.
- Does the user who upload the file is the same one as the user who will download the new file?
- Should the new file be stored somewhere or only available when the user perform the task of creating it?
Thanks for the clarification.
Buenas tardes, me podrías colaborar por favor
Necesito cargar un archivo csv a un formulario de bonita y mostrar los datos de ese archivo en otro formulario, los cuales deben ir separados por " , ".
Te agradecería tu colaboración.
I just create an example that includes two REST API extensions to do some CSV file parsing and generation. You can see the sources and download the release from the example GitHub repository.
I think it's close enough to your use case and should help you get started with REST API extension and CSV parsing.