I have wrote a code to essentially to scan line by line and extract the epoch time and count value. I was able to compare the line time with current time and make an if condition statement to increase count but I m having problems replacing the old count with the new count value. I know sed looks like the obvious choice but i cant seem to get it to work and as far as I know all sed's output go to a file not the same line...
Its a Bash Script
Last edited by abilash.amara; 12-08-2009 at 03:24 PM..
hi,
i have got a table with n number of rows and 2 columns..how can i get get 1 row at a time using any unix command without copying to any file?
Thanks and Regards
vivek.s (13 Replies)
Hi all, see i have a script that takes few arguments. first one is command we do on file, next is file (mostly txt file with lot of data) third is destination where we do something with data in file. Since im new in scripting, and im learning as i go, i need some hint how to manipulate that... (3 Replies)
Is there an awk, sed, vi or any line command that adds Field Separators (default spaces) to each line in a file?
$cat RegionalData
12FC2525MZLP8266900216
12FC2525MZLP8266900216
12FC2525NBLP8276900216
12FC2525NBLP8276900216
Desired results:
1 2 F C 2525 MZ LP 826 690 02 16
1 2 F C... (2 Replies)
This has been bothering me for 3 days.
$> hostname
cepsun64amd
And I just want "cepsun",
I would normally do h=`hostname`; ${h%%64*}
But I am looking for a one-liner just for my own knowledge, because if there is a way to do this, I should know it by now.
Anyway, so is this... (2 Replies)
Hi
I have a case where I am grabbing patterns and subsequent lines using
sed -n -e '/regex/{$!N;p;}'
This returns just the regex line when it is the last line of my file.
Now I may have even number of lines in some cases (regex never at end) and odd in very rare cases.
If the line... (6 Replies)
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
what is the difference b/w
1) #define TI_ZN (1 << 1)
#define TI_ZN (1 << 2)
and
2) #define TI_ZN 2
#define TI_ZN 4
Instead of using left shift we can assign the value 2 directly?
Or there is a reason behind this to use shift operator?... (4 Replies)
Hallo Family,
I have csv file which has over a million records in it. All i want to do is to change field 2 to have the same value as field 10.
sample file:Now
0860093239,Anonymous,unconditional,+27381230283,Anonymous,unconditional,y,public,,2965511477:0A
Desired output:
... (2 Replies)