FileSort class
FileSort provides the ability to sort files based on their columns.
FileSort does a file based merge sort and as
such can sort large files without regard to
memory constraints.
You will need free disk space equivalent to
2 times the size of the _inputPath
file.
FileSort provides a range of sort comparators including: String - case sensitive and case insenstive Numeric Month
FileSort is used by the DCli example apps dsort.dart to re-implement the standard cli tool 'sort'.
Constructors
-
FileSort(String inputPath, String outputPath, List<
Column> columns, String? fieldDelimiter, String? lineDelimiter, {bool? verbose = false}) -
Sort the file at
inputPath
and save the results tooutputPath
_inputPath
is the path to the file to be sorted_outputPath
is the path to write the sorted file to._columns
is used to describe the sort order to be applied to the selected columns._fieldDelimiter
is the delimiter to be used to separate each line of the file into columns._lineDelimiter
is the delimiter to be used to separate each line.verbose
caused FileSort to log debug level information as it sorts.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sort(
) → void - call this method to start the sort.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
expandColumns(
List< String> values) → List<Column> - Expands an list of columns defined as per Column.parse into a list of Columns.