3rd field is date and time field i want to change it with user supplied date and time says
when count is say 10 then first ten records should pick and it should increment the second fields by 1 for each record. if user suplies count = 61
then second should increment upto 59 then minute should increment and second again should with 01.
it should pick 61 records from file minute should start with 00 and second with 00 , 01 ..... 59 then minute should increment to 01:00 for 60 th record and 01:01 for 61 st
i have written awk code its not working as expected.
any rectification or any other thought ?
thanks,
Raghavendra
Last edited by radoulov; 09-05-2011 at 09:30 AM..
Reason: Code tags.
Hi,
We have csv file where date is coming in MM/DD/YYYY HH:MM:SS (06/23/2015 20:59:12) in multiple places
But we need to change the date format to DD/Mon/YYYY HH:MM:SS (23/Jul/2015 20:59:12) using shell script.
Please let us know how can we achieve the same. (16 Replies)
CSV date sorted file has multiple entries for most dates. Need to eliminate all but the first and last entries of each date, being the start and end times for that day.
2009-11-20,23:57:46
2009-11-20,23:58:46
2009-11-20,23:59:46
2009-11-21,00:00:45
2009-11-21,00:01:46
2009-11-21,00:02:45... (2 Replies)
I have a csv file formatted like this:
2014-08-21 18:06:26,A,B,12345,123,C,1232,26/08/14 18:07and I'm trying to change it to MM/DD/YYYY HH:MM for both occurances.
I have got this:
awk -F, 'NR <=1 {print;next}{"date +%d/%m/%Y\" \"%H:%m -d\""$1 "\""| getline dte;$1=dte}1' OFS="," test.csvThis... (6 Replies)
I've found 2 great discussions on this forum that are tied to my question, but for some reason, neither solution works for me.
I have a CSV file with many records, up to 150+ at some times. Many records have a value of H in $1. For those records, I need to add today's current date in $20. I'm... (4 Replies)
Hi,
I've been trying (and failing miserably) all morning to strip from a CSV file the time from it.
Can somebody point me in the right direction on how to do this using sed or awk?
The file looks like:
"James","07/20/2009-14:40:11"
"Steve","08/06/2006-02:34:37"... (5 Replies)
Hi,
Im having a hard time in creating a script with the following conditions below. I have a csv file generated which is updated every 5 mins and it contains a timestamp in it. for example:
time data
00:00 1
00:05 0
00:10 6
00:15 3
however, there is a time that... (4 Replies)
I need to insert data into a perticular field of a csv file, lets say second field.
Can any one help me to do this?
I found that we can do it with sed. can any one guide me to accomplish this?
thanks in advance. (12 Replies)
I need to converts a CSV file from Format "A" into Format "B", where the first field is repeated in a loop with a counter. I'am quite sure that this is with AWK possible burt the "Forum Search Function" doesn't work at the moment.
Format "A"
A1;B1
;B2
;B3
A2;C1
;C2
;C3
... (2 Replies)
Hi
I am accessing a file on nfs mounted device, after completing using of the file, i am tring to restore the access time and modification times of the file.
So i got the previous modified time of the file using stat() function and trying to set the date and time for the file, To set these... (6 Replies)