in reply to Re^2: localtime function
in thread localtime function

Here's my Input file: sourceIP geographic startTime endTime sourcePort 192.168.0.123 Other 1.42E+12 1.42E+12 61077 115.239.228.15 Asia.China 1.42E+12 1.42E+12 47308 74.125.206.188 NorthAmerica.UnitedStates 1.42E+12 1.42E+12 5228 92.51.156.102 Europe.Germany 1.42E+12 1.42E+12 5938 1.1.1.1 Oceania.Australia 1.42E+12 1.42E+12 N/A 201.48.158.12 SouthAmerica.Brazil 1.42E+12 1.42E+12 34290 64.233.167.188 NorthAmerica.UnitedStates 1.42E+12 1.42E+12 5228 50.87.144.182 NorthAmerica.UnitedStates 1.42E+12 1.42E+12 2096 180.222.178.177 Asia.Japan 1.42E+12 1.42E+12 48264 54.161.79.163 NorthAmerica.UnitedStates 1.42E+12 1.42E+12 8576 1.1.1.2 Oceania.Australia 1.42E+12 1.42E+12 123 172.16.16.100 Other 1.42E+12 1.42E+12 138

THe whole input is getting into array while I want the data part only to play with leaving the header fields as it is.

Replies are listed 'Best First'.
Re^4: localtime function
by pme (Monsignor) on Jan 28, 2015 at 07:29 UTC
    Please read localtime.

    Would you share a few lines of your input file?

Re^4: localtime function
by Anonymous Monk on Jan 28, 2015 at 21:36 UTC

    Without knowing what your input file exactly looks like, I can only guess that the problem is that you've got "invalid" time values in there that you might want to filter out or fix when converting.

    localtime() is taking starttime as a string & converting it to a default date

    Yes, that is what localtime does. What is the problem?

    You still haven't shown us: a representative sample of your input (i.e. a properly formatted copy-paste of the input file including those lines that cause the problem), your exact expected output; also your posts still aren't formatted properly.

    Please take the time to read, understand and follow How do I post a question effectively? - help us to help you and you will find your questions can be answered much better and faster.