-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
detectImportOptions, readcell, readtable functions (#1298)
- Implement detectImportOptions for CSV import configuration - Add readtable function for importing tabular data - Enhance readcell with new import options - Update ArrayOf to support table data type - Implement optimized join() function for string concatenation - Add strjust() implementation with performance improvements - Fix #1292 - Refactor table display functionality
- Loading branch information
1 parent
e17e2ed
commit c3bf24b
Showing
75 changed files
with
3,953 additions
and
472 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
otherwise | ||
c = 'not sure'; | ||
end | ||
endfunction | ||
end | ||
]]> | ||
</example_item_data> | ||
</example_item> | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
><![CDATA[function myfun() | ||
global y; | ||
y = 1; | ||
endfunction | ||
end | ||
myfun() | ||
who | ||
|
This file contains 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
This file contains 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
This file contains 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
53 changes: 53 additions & 0 deletions
53
modules/spreadsheet/builtin/cpp/detectImportOptionsBuiltin.cpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//============================================================================= | ||
// Copyright (c) 2016-present Allan CORNET (Nelson) | ||
//============================================================================= | ||
// This file is part of the Nelson. | ||
//============================================================================= | ||
// LICENCE_BLOCK_BEGIN | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// LICENCE_BLOCK_END | ||
//============================================================================= | ||
#include "detectImportOptionsBuiltin.hpp" | ||
#include "Error.hpp" | ||
#include "InputOutputArgumentsCheckers.hpp" | ||
#include "DetectImportOptions.hpp" | ||
//============================================================================= | ||
using namespace Nelson; | ||
//============================================================================= | ||
ArrayOfVector | ||
Nelson::SpreadsheetGateway::detectImportOptionsBuiltin(int nLhs, const ArrayOfVector& argIn) | ||
{ | ||
ArrayOfVector retval; | ||
nargoutcheck(nLhs, 0, 1); | ||
nargincheck(argIn, 1, 1); | ||
|
||
std::wstring filename = argIn[0].getContentAsWideString(); | ||
|
||
detectImportOptions options; | ||
initializeDetectImportOptions(options); | ||
|
||
std::string errorMessage; | ||
analyzeFileFormatImportOptions(filename, 4096, options, errorMessage); | ||
if (!errorMessage.empty()) { | ||
Error(errorMessage); | ||
} | ||
|
||
stringVector fieldnames = { "Delimiter", "LineEnding", "CommentStyle", "EmptyLineRule", | ||
"VariableNamesLine", "VariableNames", "RowNamesColumn", "DataLines" }; | ||
ArrayOfVector fieldvalues; | ||
|
||
fieldvalues << ArrayOf::toCellArrayOfCharacterRowVectors(options.Delimiter); | ||
fieldvalues << ArrayOf::toCellArrayOfCharacterRowVectors(options.LineEnding); | ||
fieldvalues << ArrayOf::toCellArrayOfCharacterRowVectors(options.CommentStyle); | ||
fieldvalues << ArrayOf::characterArrayConstructor(options.EmptyLineRule); | ||
fieldvalues << ArrayOf::doubleConstructor(options.VariableNamesLine); | ||
fieldvalues << ArrayOf::toCellArrayOfCharacterRowVectors(options.VariableNames); | ||
fieldvalues << ArrayOf::doubleConstructor(options.RowNamesColumn); | ||
fieldvalues << ArrayOf::doubleVectorConstructor(options.DataLines); | ||
|
||
ArrayOf importOptions | ||
= ArrayOf::classConstructor("DelimitedTextImportOptions", fieldnames, fieldvalues); | ||
retval << importOptions; | ||
return retval; | ||
} | ||
//============================================================================= |
Oops, something went wrong.