Skip to content

Add comment option to splitCsv operator (#6705)#6896

Open
oqadiSAK wants to merge 1 commit intonextflow-io:masterfrom
oqadiSAK:add-splitcsv-comment-option
Open

Add comment option to splitCsv operator (#6705)#6896
oqadiSAK wants to merge 1 commit intonextflow-io:masterfrom
oqadiSAK:add-splitcsv-comment-option

Conversation

@oqadiSAK
Copy link

@oqadiSAK oqadiSAK commented Mar 5, 2026

Add support for comments in CSV and TSV files when using the splitCsv() operator.

Closes #6705

Changes

  • Add comment option to splitCsv() operator
  • Lines starting with the comment character are skipped entirely
  • Text following the comment character mid-line is ignored
  • Must be a single character (e.g., #, ;)
  • Disabled by default to maintain backward compatibility

Note: While RFC 4180 does not define a comment standard for CSV, this implementation follows pandas' read_csv() behavior as a widely-adopted convention: single character only, and comments affect both line-start and mid-line positions.

Example usage:

channel.of('# comment\na,b,c\nd,e # inline comment')
    .splitCsv(comment: '#')
    .view()

Output:

[a, b, c]
[d, e ]

Signed-off-by: oqadiSAK <salihardakizils@gmail.com>
@oqadiSAK oqadiSAK requested a review from a team as a code owner March 5, 2026 20:31
@netlify
Copy link

netlify bot commented Mar 5, 2026

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit fc66e8f
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69a9e812ab73a400080b35a7
😎 Deploy Preview https://deploy-preview-6896--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Expand .splitCsv() to allow comments in CSV and TSV files

1 participant