cancel
Showing results for 
Search instead for 
Did you mean: 

how to read csv file having delimiters as separators using groovy script

SOLVED
aparna_11
New Contributor

how to read csv file having delimiters as separators using groovy script

Can anyone share sample code how to read CSV file having delimiter as separator and what all jars required

1 ACCEPTED SOLUTION

Accepted Solutions
ZDGN
Contributor

Re: how to read csv file having delimiters as separators using groovy script

Hi @aparna_11 

 

May be you could find some useful informations here:

https://www.baeldung.com/groovy-file-read

 

For example by reading your file line by line, and then split each line with the separator you use into your CSV file.

It will provide you a list of items for your line.

To go further, you can also declare a specific class for stocking your values and use a list to populate all of your data.

 

Hope this helps.

 

 

David.

View solution in original post

3 REPLIES 3
ZDGN
Contributor

Re: how to read csv file having delimiters as separators using groovy script

Hi @aparna_11 

 

May be you could find some useful informations here:

https://www.baeldung.com/groovy-file-read

 

For example by reading your file line by line, and then split each line with the separator you use into your CSV file.

It will provide you a list of items for your line.

To go further, you can also declare a specific class for stocking your values and use a list to populate all of your data.

 

Hope this helps.

 

 

David.

View solution in original post

aparna_11
New Contributor

Re: how to read csv file having delimiters as separators using groovy script

@ZDGN  David

Thank you for your support i could able to read data from CSV file. The link you provided is helpful

 

Thank you again

Aparna

richie
Community Hero

Re: how to read csv file having delimiters as separators using groovy script

@ZDGN,

That link you provided is great!

Really helpful. Kudos definitely earned on that one fella!

Nice one

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Top Kudoed Authors