FileHelpers - Sort Big File without Record Class 1

  • Contact / Feedback
  • Introduction
  • Download
  • Quick Start
  • Must Read
  • Examples
    • QuickStart
      • Read Delimited File
      • Write Delimited File
      • Read Fixed File
      • Write Fixed File
      • Read or Write Record by Record
      • Autoproperties
    • Missing Values
      • Handle Missing Values with Nullable
      • Handle Missing Values With FieldNullValue
    • Attributes
      • FieldTrim
      • FieldOrder
      • FixedLengthRecord FixedMode.AllowLessChars
    • Converters
      • Enum Converter
      • Custom Converter
    • Events And Notification
      • INotifyRead Interface
      • INotifyWrite Interface
      • Before/After Read Event Handling
      • Before/After Write Event Handling
    • ErrorHandling
      • ErrorMode.ThrowException
      • ErrorMode.IgnoreAndContinue
      • ErrorMode SaveAndContinue
    • Advanced
      • Dynamic Engine Options
      • Multiple Delimiters
      • Multi Record Processing
      • Smart Format Detector
    • Sorting
      • Sort Big File with Record Class
      • Sort Big File without Record Class 1
      • Sort Big File without Record Class 2
    • MasterDetail
      • Master Detail Custom Selector
      • Master Detail Common Selector
  • Credits
  • Invite us a beer
  • Contribute
  • Source Code
  • Api Docs (Sandcastle)
  1. Examples
  2. Sorting
  3. Sort Big File without Record Class 1
Previous: Sort Big File with Record Class
Next: Sort Big File without Record Class 2
Click button to edit
Sorting: Sort Big File without Record Class 1
Shows how to sort a big file without a record class

Implements External Sorting (wikipedia)

You don't need to declare a record class to sort a file, you can sort with a compare method

SortingWithoutRecord.cs
// Sort comparing the raw lines
var sorter = new BigFileSorter((x, y) =>
        string.Compare(x, y, StringComparison.Ordinal));


sorter.Sort("unsorted.txt", "sorted.txt");
Copyright © 2020 Devoo - Marcos Meli All rights reserved. Template Design by GeeksLabs