Merged
Conversation
Swaps rows and columns of NSV table data. Requires uniform row arity — exits with an error on ragged input. Works at the byte level (decode_bytes → transpose → encode_bytes). https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
Read → decode → move cells into transposed structure → encode. No intermediate copies. No silent BOM/CRLF fixup — pipe through nsv sanitize if needed. https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
Write each transposed row directly by iterating columns, avoiding allocation of the entire transposed structure. https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
Transpose is structure-only: it rearranges cells without modifying content. Work directly with escaped line slices instead of decoding then re-escaping each cell. https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
Replace verbose unwrap_or_else(panic!) with ?, returning io::Result. Caller handles BrokenPipe silently. https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
Match the pattern used by sanitize: return Result<(), String> and let main handle printing and exit code. https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
Drop redundant description, show involution as a pipeline. https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
transposecommand that swaps rows and columns in NSV (Newline Separated Values) data. The implementation includes comprehensive test coverage.Key Changes
transposecommand: Added to the CLI with support for file input or stdintests/test_transpose.shwith 11 test cases covering:Implementation Details
https://claude.ai/code/session_01QPwRx4hq2FgScPdegPr7ap