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

Improved column separator detection by ignoring quoted sections #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nicastelo
Copy link

Summary:

This pull request enhances the logic used to determine the column separator (delimiter) in CSV files processed by our system. Previously, the method guess_column_separator simply counted occurrences of potential delimiters (such as commas, tabs, semicolons, colons, and pipes) without considering their context. This could lead to misidentification, especially when non-delimiter characters within quoted fields were mistaken for actual delimiters. The updated logic now intelligently ignores delimiters found within quoted sections, leading to more accurate delimiter detection.

Changes:

  • Modified the guess_column_separator method to exclude text within quotes when counting delimiter occurrences.
  • Added regex-based splitting to remove quoted sections before counting delimiter occurrences in each line.

@nicastelo nicastelo marked this pull request as ready for review March 14, 2024 18:12
@nicastelo nicastelo changed the title Improved column separator detection by Ignoring quoted sections Improved column separator detection by ignoring quoted sections Mar 14, 2024
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.

1 participant