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 ability to prepend each chunk with the file header line #912

Closed
christopher-mohr opened this issue Oct 30, 2018 · 7 comments
Closed
Milestone

Comments

@christopher-mohr
Copy link

christopher-mohr commented Oct 30, 2018

In some cases you might want to split a file into multiple files while keeping the header of the original file in each file chunk. Currently, the operator splitText does not provide this functionality nor a parameter to provide whether the original file contains a header.

@baffelli
Copy link
Contributor

You may want to consider the splitCsv operator, which does exactly what you request.

@christopher-mohr
Copy link
Author

As far as I know splitCsv cannot be used to generate file chunks (automatically).

@pditommaso
Copy link
Member

Oh really?

@sven1103
Copy link
Contributor

But according to the operator docs, splitCsv() has no parameter file, like splitText() has, which writes the files automatically after splitting.

@pditommaso pditommaso added this to the v19.1.0 milestone Oct 31, 2018
@pditommaso pditommaso changed the title Add functionality to splitText operator in order to keep header in each file chunk Add ability to prepend each chunk with the file header line Oct 31, 2018
pditommaso added a commit that referenced this issue Oct 31, 2018
This commit add the option keepHeader to the splitText operator. 
When true the first line is interpreted as a header and prepended 
to each chunk produced by the operator.
@pditommaso
Copy link
Member

I've added keepHeader option that will retain the first line in the file and prepend as header to each chunk. It will be included in the next release.

lorenzgerber pushed a commit to lorenzgerber/nextflow that referenced this issue Nov 1, 2018
This commit add the option keepHeader to the splitText operator. 
When true the first line is interpreted as a header and prepended 
to each chunk produced by the operator.

Signed-off-by: Lorenz Gerber <gerberlo@gis.a-star.edu.sg>
@sven1103
Copy link
Contributor

sven1103 commented Nov 4, 2018

thanks a lot @pditommaso !

@christopher-mohr
Copy link
Author

Thank you @pditommaso !

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

No branches or pull requests

4 participants