I have a comma delimited file of major codes and descriptions. I want to replace all occurrences of spaces with underscores up to the first comma (only in the first field), but not replace spaces following the comma. For instance I have the following snippet of the file:
EK ED,Elementary and Kindergarten Education
OBGYN,Obstetrics/gynecology
BL EB,"Engineering, Business, and Human Development"
CONTE,Continuing Education Students
STAFF,Student Affairs
BANTH,Biological Anthropology
C PSY,Community Psychology
LAIDS,Liberal Arts Interdisciplinary Programs
The first line should become:
EK_ED,Elementary and Kindergarten Education
The second line should remain unchanged
The third line should become:
BL_EB,"Engineering, Business, and Human Development"
EK_ED Elementary and Kindergarten Education
OBGYN,Obstetrics/gynecology
BL_EB "Engineering Business and Human Development"
CONTE,Continuing Education Students
STAFF,Student Affairs
BANTH,Biological Anthropology
C_PSY Community Psychology
LAIDS,Liberal Arts Interdisciplinary Programs