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

"sum of all the fields on all lines" wrongly combines last-of-line with first-of-next-line #29

Open
timo opened this issue Oct 28, 2017 · 1 comment

Comments

@timo
Copy link
Collaborator

timo commented Oct 28, 2017

you're calling .split on an array, which will first stringify the array by inserting single spaces between the lines and then splitting it by "\t". That causes fields from the end of one line and the beginning of the next line to be considered a single field with a space in the middle.

you'll need something like lines>>.split("\t")>>.Slip.&flat or lines.join("\t").split("\t") to get the right behavior

@timo
Copy link
Collaborator Author

timo commented Oct 28, 2017

this also goes for "find the total number of fields (words) on all lines" example.

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

1 participant