Skip to content

Instantly share code, notes, and snippets.

@jaskirat1208
jaskirat1208 / csv_file_parser.cpp
Last active March 23, 2022 06:58
Parsing CSV file
/* Bad practice */
address = col[5] + col[6] + col[7]
/* Clean code. Preferable and a lot easier to read by the team
as well as yourself when you have spent time away from the project. */
HOME_IDX = 5
STREET_IDX = 6
LANDMARK_IDX = 7
address = col[HOME_IDX] + col[STREET_IDX] + col[LANDMARK_IDX]