Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: search date occurance from csv column

by graff (Chancellor)
on Mar 19, 2014 at 03:17 UTC ( #1078889=note: print w/ replies, xml ) Need Help??


in reply to search date occurance from csv column

It's not clear what you want to get as a result from your script. When you say:

i need to use the current date search each column to get the number of occurrence from each columns

I'm afraid that doesn't make any sense in English. Perhaps you can give an example of data that should produce a particular output, and tell us what that particular output should be.

I notice that sample data you gave uses semi-colons between the fields (;), but you are using a comma in your split call (,), so @fields would always have a single element containing the whole line (because there are no commas), and $fields[2] will always be undef.

Anyway, assuming that you do the split the right way, what do you really want to do with the second date string of each line?


Comment on Re: search date occurance from csv column
Download Code
Re^2: search date occurance from csv column
by anakin30 (Acolyte) on Mar 19, 2014 at 03:42 UTC

    My apology for making things not clear

    I give you an example on what i want to achieve, let say today's date is 20140319 (based on format YYYYMMDD) i want to use this date to search the column date1 and date2 to find how many occurrence are there from each column and provide the total occurrences.

    expected output is as following

    column date1 = xx occurence

    column date2 = xx occurence

    __DATA__

    input file

    Student ID;date1;date2

    13645722;20110327203202.0Z;20140211204731.0Z

    14947374;20110327203202.0Z;20140220135320.0Z

    15962660;20110327203156.0Z;20131106113716.0Z

    17480884;20110327212821.0Z;20131211143804.0Z

    13054554;20110327203141.0Z;20131205162959.0Z

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078889]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2014-09-21 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls