in reply to Re: CSV regex with hash/array program plan
in thread CSV regex with hash/array program plan
The sort of thing i had in mind is
use feature "switch"; for (to be determined) { when ((s/(\b[A-E]{3}\b)/XXX/g)) {@array[i,1] = $1} when (s/((Science)|(science))/XXX/g) {@array[i,2] = $1} when (s/((Math)|(math))/XXX/g) {@array[i,3] = $1} when - for all remaining subjects... when (s/((first|First)\W+(?:\w+\W+){1,10}?([A-E]{3})) #or some similar + REGEX returning only the first year entry grades default {} }
but i'm concerned that i'm thinking very "C" in my iteration loop for the array
To answer Anonymous monk,
To start with, i'd be very happy with an output that looks like below:
(subject)..|ABB|Maths|Physics|Design&Technology|Engineering
If i can get the progam to do this above, then i'll try and refine it to pull out specific grades
eg ([A-E]{1} in Design|design) returns the grade preceding that subjectRoboticus, thanks for that i may start with a defined array (there are ~200 A level possibilities, but they change very infrequently)and then develop it into one which adds subjects when detected once i get the hang of it.
You have also hit the nail on the head regarding the REGEXes, i was thinking about having a list produced of ones that the regex struggled with, or ones which didn't get any hits to see how i'm missing things too. I'd not thought about multiple passes however, nor repairing misspellings!
really appreciate the input i just need to plough through some text books and remind myself (or learn new things) appropriate to the task in hand
best wishes, Phil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CSV regex with hash/array program plan
by AnomalousMonk (Archbishop) on Nov 23, 2014 at 21:57 UTC | |
by Anonymous Monk on Nov 24, 2014 at 01:16 UTC |