Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of a CVS reader block #223

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

azoitl
Copy link
Contributor

@azoitl azoitl commented Sep 5, 2024

No description provided.

void GEN_CSV_READER::openCSVFile() {
QO() = false_BOOL;
if(!mCSVFile.is_open()) {
mCSVFile.open(FILE_NAME().getStorage().c_str());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are calling c_str() several times. I would suggest to store the result of the first call and use it later, as FILE_NAME will probably not modified in this function anymore

std::size_t oldPos = 0;

for(std::size_t i = 0; i < getNumRD(); i++) {
std::size_t newPos = line.find(';', oldPos);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeing this, you implicitly assume a German-language CSV file, correct?
English-language (and several others) CSVs use the comma ',' as the separator.
In the current version the use of the CSV Reader is limited to German-language (or others using the semicolon as separator) CSVs. I would suggest to extract the separator to an additional input for the FB, enhancing usability of the FB

@diplfranzhoepfinger
Copy link

GOOD ! 

as said, i would like to make a INI-File Reader-Writer Block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants