This PR establishes the initial foundational load for the splitfile utility. It introduces a lightweight, efficient C# console application designed to deconstruct large delimited text files into smaller, manageable segments.
Core Functionality
Stream-Based Splitting: Implements a StreamReader/StreamWriter pattern to process large files line-by-line, ensuring low memory overhead regardless of the source file size.
Header Preservation: Includes logic to detect and replicate the header row across all generated sub-files, maintaining data integrity for downstream processing.
Intelligent File Sizing: Automatically calculates segment sizes (defaulting to 10% of the original file) or accepts custom maxSize constraints.
Flexible Formatting: Supports configurable output file naming conventions via standard C# string formatting (e.g., gmdnTerms-{0:000}.txt).
Project Components
File
Description
Program.cs
Contains the core Split logic, including encoding detection and file stream management.
splitfile.csproj
Configured for .NET 6.0 with Implicit Usings and Nullable reference types enabled.
splitfile.sln
Visual Studio 2022 solution file for local development.
Usage Notes
The current entry point is configured to process the AccessGUDID delimited release files. To target different files, update the path, input, and format variables within Main.
Note for Reviewers: This is a focused initial commit (3 files) that provides a functional baseline for file manipulation. The implementation includes a finally block to ensure all file handles are properly disposed of, even in the event of an I/O failure.
## **PR Summary: Initial Base Code for SplitFile**
This PR establishes the **initial foundational load** for the `splitfile` utility. It introduces a lightweight, efficient C# console application designed to deconstruct large delimited text files into smaller, manageable segments.
---
### **Core Functionality**
* **Stream-Based Splitting**: Implements a `StreamReader`/`StreamWriter` pattern to process large files line-by-line, ensuring low memory overhead regardless of the source file size.
* **Header Preservation**: Includes logic to detect and replicate the header row across all generated sub-files, maintaining data integrity for downstream processing.
* **Intelligent File Sizing**: Automatically calculates segment sizes (defaulting to 10% of the original file) or accepts custom `maxSize` constraints.
* **Flexible Formatting**: Supports configurable output file naming conventions via standard C# string formatting (e.g., `gmdnTerms-{0:000}.txt`).
### **Project Components**
| File | Description |
| :--- | :--- |
| **Program.cs** | Contains the core `Split` logic, including encoding detection and file stream management. |
| **splitfile.csproj** | Configured for **.NET 6.0** with Implicit Usings and Nullable reference types enabled. |
| **splitfile.sln** | Visual Studio 2022 solution file for local development. |
### **Usage Notes**
The current entry point is configured to process the `AccessGUDID` delimited release files. To target different files, update the `path`, `input`, and `format` variables within `Main`.
---
**Note for Reviewers:** This is a focused initial commit (3 files) that provides a functional baseline for file manipulation. The implementation includes a `finally` block to ensure all file handles are properly disposed of, even in the event of an I/O failure.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
PR Summary: Initial Base Code for SplitFile
This PR establishes the initial foundational load for the
splitfileutility. It introduces a lightweight, efficient C# console application designed to deconstruct large delimited text files into smaller, manageable segments.Core Functionality
StreamReader/StreamWriterpattern to process large files line-by-line, ensuring low memory overhead regardless of the source file size.maxSizeconstraints.gmdnTerms-{0:000}.txt).Project Components
Splitlogic, including encoding detection and file stream management.Usage Notes
The current entry point is configured to process the
AccessGUDIDdelimited release files. To target different files, update thepath,input, andformatvariables withinMain.Note for Reviewers: This is a focused initial commit (3 files) that provides a functional baseline for file manipulation. The implementation includes a
finallyblock to ensure all file handles are properly disposed of, even in the event of an I/O failure.