Hi folks,
i'm having a problem with transform a dataset. i have a dataset, it has a 15-mins speed profile on a road for both weekday and weekend. now i want to map this speed profile onto the road for 1 year. example of the dataset is as follows, it's in CSV file format, (first 96 is for weekday, later 96 is for weekend)
32.61712_29.23591_24.84628_22.84434_30.59529_28.76819_35.03523_.......
the final table i want to generate from perl is:
| link_number |
time_interval |
day of the week |
speed |
| 1 |
1 |
1(monday) |
32.61712 |
| 1 |
2 |
1(monday) |
29.23591 |
| ... |
| 1 |
97 |
2(tuesday) |
32.61712 |
.....
anyone has idea how to do this ? i'm thinking to use the PERL read the csv file as array and use conditional statement according to 'day of the week' to load either first 96 or later 96 speed value. but i don't know how to write this, any ideas ?
thanks,
Simon
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.