Skip to content

Implemented multi-row class parsing for subgroups and fixed data.json#67

Open
iakshatkaushik wants to merge 1 commit into
utkarsh-1905:mainfrom
iakshatkaushik:main
Open

Implemented multi-row class parsing for subgroups and fixed data.json#67
iakshatkaushik wants to merge 1 commit into
utkarsh-1905:mainfrom
iakshatkaushik:main

Conversation

@iakshatkaushik

Copy link
Copy Markdown

… creationThis pull request introduces significant improvements to how the timetable generator parses data from the timetable.xlsx Excel file.

Key Changes:

  • Multi-row Class Subgroup Parsing: The previous logic only considered a single row for identifying class names. This update modifies utils/genData.go to correctly read and extract class subgroups (e.g., "2C11", "2C12") from row 5 of the Excel sheets, while still respecting the main group headers in row 4. This addresses scenarios where class sections are listed in a hierarchical manner across multiple rows.
  • Robust Class Name Extraction: The parsing logic in utils/genData.go has been made more flexible to accurately identify class/subgroup names by filtering out common non-class headers (like "BRANCH", "LECTURE", "TUTORIAL") that might appear in the header rows.
  • Improved data.json Creation: Updated utils/genData.go to use os.Create when generating data.json, resolving "no such file or directory" errors and ensuring the JSON output file is always correctly created or overwritten.
  • Adjusted Start Row: The startRow constant in utils/data.go has been updated from 7 to 8 to correctly align with the actual start of timetable data in the provided Excel files.

Why these changes?

These updates are crucial for accurately processing timetable Excel files that use a two-row structure for defining main classes and their respective subgroups. This ensures that all available class sections are correctly identified and displayed in the web application, making the tool more versatile for different timetable formats.

This resolves the issue where only main groups were visible and subgroups were missing from the selection options.

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