Mar
Sat
13
admin
  • I'm looking for perl script to analyze a CSV file. Here is a sample of the file. 2-28-2005:2:13 AM,48.2,48.2,100,30.01,0.8,WNW,3.5,-,N/A,,Mist 2-28-2005:2:53 AM,46.0,46.0,100,30.00,0.5,NNW,4.6,-,N/A,Fog,Fog 2-28-2005:3:04 AM,48.2,48.2,100,30.02,3.0,NNW,3.5,-,N/A,,Overcast 2-28-2005:3:53 AM,46.9,46.9,100,30.01,1.0,West,3.5,-,N/A,,Overcast 2-28-2005:4:01 AM,46.4,46.4,100,30.03,0.5,West,4.6,-,N/A,Fog,Fog 2-28-2005:4:35 AM,46.4,46.4,100,30.04,0.8,West,4.6,-,N/A,,Overcast 2-28-2005:4:53 AM,46.9,46.9,100,30.02,0.8,WNW,3.5,-,N/A,,Overcast 2-28-2005:5:01 AM,46.4,46.4,100,30.04,1.5,WNW,3.5,-,N/A,,Overcast 2-28-2005:5:07 AM,46.4,46.4,100,30.04,3.0,Calm,Calm,-,N/A,,Overcast 2-28-2005:5:35 AM,48.2,48.2,100,30.05,5.0,NNW,5.8,-,N/A,,Overcast 2-28-2005:5:53 AM,46.9,46.9,100,30.04,10.0,NW,8.1,-,N/A,,Overcast 2-28-2005:6:53 AM,48.0,46.0,93,30.06,10.0,NNW,5.8,-,N/A,,Overcast 2-28-2005:9:53 AM,50.0,46.4,87,30.13,10.0,North,5.8,-,N/A,,Overcast 2-28-2005:11:06 AM,51.8,46.4,82,30.13,10.0,Variable,3.5,-,N/A,,Scatt 2-28-2005:2:53 PM,60.8,48.2,63,30.06,10.0,Calm,Calm,-,N/A,,Scattered 2-28-2005:3:47 PM,60.8,46.4,59,30.05,10.0,Variable,3.5,-,N/A,,Clear It essentially shows cronological weather data. What I'm interested in would be to analyze each line and compare time stamps and come up with a diff between the time. So for these two lines of the CSV. 2-28-2005:2:53 PM,60.8,48.2,63,30.06,10.0,Calm,Calm,-,N/A,,Scattered 2-28-2005:3:47 PM,60.8,46.4,59,30.05,10.0,Variable,3.5,-,N/A,,Clear I would like an additional column that says 54 min have passed and do this for each and every line within the CSV, the files vary in size, some have 5000 lines some have 150000. AFter the last record I would then like to sum up all the minutes or hours, each would be acceptable. So with the additional column added for time diff, I also need some columns which determine whether or not column #6 is less than or equal to 2,1,0.5,0.3,0.1, and 0, If they are >2 I dont really care. So for each row. If total time was say 8000 hours, and this row represented 54 minutes of that 8000 hours it would be about 0.01125% of the total time. I want to track the percentages when that column is a specific values, i.e. 2,1,0.5,0.3,0.1 and 0, then add the percentages up at the end to get a total time within that given range.


  • I can do this pretty easily. Let me know jason ## quickbrowse.com







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Perl Script to analyze and add data to CSV file , Please add it free.
    • edit