Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ballerina by examples for CSV data module #5524

Closed

Conversation

SasinduDilshara
Copy link
Contributor

@SasinduDilshara SasinduDilshara commented Jul 30, 2024

Add ballerina by examples for CSV data module
Fixes ballerina-platform/ballerina-dev-website#9299

Copy link

sonarcloud bot commented Jul 30, 2024

@@ -0,0 +1,9 @@
# CSV to record conversion with projection

The `data.csv` library provides multiple APIs to selectively convert required fields from CSV data in the form of a `string`, `byte[]`, `byte-block-stream`, `record-array` and `anydata-array-of-array` to a Ballerina anydata array of array.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In here it is better to explain more about projection.

1984,George Orwell,1949,Secker & Warburg`;

public function main() returns error? {
// Convert the CSV value of type record array into a string array of array with projection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is it correct to say that this is a CSV value because the value is actually a array of records.

@@ -0,0 +1,2 @@
description: This BBE illustrates how to selectively convert fields from a CSV source, which can be provided as a string, byte array, byte block stream, record array or anydata array of array into a anydata array of array in Ballerina.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the types described here as in this file csv_to_anydata_array_with_projection.md. WDYT?

@SasinduDilshara SasinduDilshara marked this pull request as draft August 1, 2024 11:10
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@SasinduDilshara
Copy link
Contributor Author

This PR will draft until ballerina-platform/module-ballerina-data.csv#4 get merge

@SasinduDilshara
Copy link
Contributor Author

This PR will be reopen after ballerina-platform/module-ballerina-data.csv#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ballerina by examples for CSV data module
3 participants