M
markpark
I know perl is good for what i need to do but i find regular
expressions very difficult and
and this is what i think is needed.
IBM2006-09-29 09:30:03.00000N7800081.90000000N003398C
IBM2006-09-29 09:30:04.00006N70081.90000000N003412C
I have a lines in a file such as above and all i want to pull is the
fields
date and time ( 1 field )
2006-09-29 09:30:03
and the price
81.9
and write them out top a file with a comma in between the two fields.
i don't even want the letters IBM in the output.
an additional complication is is that there are cases where the price
could be in the hundreds in
which case, it has to be taken out to 3 digits before the decimal
rather than just 2.
another additional complication is that the stock could be MSFT in
which
case therew are 4 characters first instead of 3.
so , essentially, the price is always the four numbers before the
second dot in the file
but the 2 digits after the second dot are part of the price also.
if that helps ?
this problem seems like a mess to me.
i have read about regular expressions and i've tried and i think i
might be able
to figure the above out after a couple of weeks. but, right now i
don['t have a couple of weeks to spare. i promise that, if someone is
kind enough to give the answer,
i will grind through it no matter how long it takes me to make sure i
understand every piece.
thanks a lot.
expressions very difficult and
and this is what i think is needed.
IBM2006-09-29 09:30:03.00000N7800081.90000000N003398C
IBM2006-09-29 09:30:04.00006N70081.90000000N003412C
I have a lines in a file such as above and all i want to pull is the
fields
date and time ( 1 field )
2006-09-29 09:30:03
and the price
81.9
and write them out top a file with a comma in between the two fields.
i don't even want the letters IBM in the output.
an additional complication is is that there are cases where the price
could be in the hundreds in
which case, it has to be taken out to 3 digits before the decimal
rather than just 2.
another additional complication is that the stock could be MSFT in
which
case therew are 4 characters first instead of 3.
so , essentially, the price is always the four numbers before the
second dot in the file
but the 2 digits after the second dot are part of the price also.
if that helps ?
this problem seems like a mess to me.
i have read about regular expressions and i've tried and i think i
might be able
to figure the above out after a couple of weeks. but, right now i
don['t have a couple of weeks to spare. i promise that, if someone is
kind enough to give the answer,
i will grind through it no matter how long it takes me to make sure i
understand every piece.
thanks a lot.