Question
Infosys
IN
Last activity: 18 Jul 2017 10:42 EDT
Reading The Contents Of A CSV File
I have a requirement where i will have to read the contents of a csv file which is manually uploaded and attached to the work object. Are there any OOTB features available for this or if not any suggestions on how this can be acheived? The contents can be read and stored in a pagelist
***Updated by moderator: Lochan to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 24 Jun 2015 11:47 EDT
See the following PDN articles, if those help:
https://pdn.pega.com/integration/how-to-parse-comma-separated-value-csv-files
https://pdn.pega.com/integration/how-to-parse-a-comma-separated-values-csv-file-using-a-file-service
Updated: 24 Jun 2015 13:50 EDT
Pegasystems Inc.
US
In addition to the PDN Articles that Aditya Sirohi cited, GCS KR-1521, Importing data from a CSV file to a repeating grid layout using FilePath and Parse-Delimited (Internet Explorer, Pega 7.1.6), developed by Yasuhiro Ito for a new PDN Article, is currently under review. Watch for the publication of this new article, coming soon.
Common Wealth Bank of Australia
AU
Have this article " Importing data from a CSV file to a repeating grid layout using FilePath and Parse-Delimited" been published?
Updated: 5 Jan 2016 17:10 EST
Common Wealth Bank of Australia
AU
Just found the details in PDN: Here is the link https://docs-previous.pega.com/importing-data-csv-file-repeating-grid-layout-using-filepath-and-parse-delimited-internet-explorer
Thanks.
Sri
Infosys
IN
I am looking forward to the article by Yasuhiro ito. We are currently working on the version 6.3 . When working with a file listener the file service rule is used to read the contents of each csv file. But, when the file is uploaded, can we configure the Service File rule to read the file or how do we replicate the functions which theService File rule performs when used with a listener?
Pegasystems Inc.
IN
Please find the below steps, if the actions read, parse and process are to be built without listener rule...
- upload the file using OOTB control FilePath
- read the file path (step #5)
- apply delimiter (comma) in a for each block and invoke case creation along with attach the data as an attachment object.
first line: byte[] tempBytes = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(tools.findPage("pyNewFileAttachment").getString("DisplayAttachedStreamContent"));
Infosys
IN
Thanks phani. will try this.
Common Wealth Bank of Australia
AU
Hi Gaurav,
Have you tried the above suggested by Phani?
We have a similar requirement , to read the contents of the CSV file and create a work object for each line in the CSV. The CSV file will be uploaded by the user and not through the file listener.
Hence, I hope I should follow Phani's code. Any further details on this would be helpful.
Regards,
Sri
Infosys
IN
Hi Srividhya,
Apologies for the delayed response. I have tried phani's code with slight modifications to suit our requirements and it works well.
Cheers