Search Results

Search: Posts Made By: jaduks
25,841
Posted By jaduks
$ cat details.txt 2424|asdsd|121 ...
$ cat details.txt
2424|asdsd|121
1212|adad|9898
12|6767

$ awk 'BEGIN {OFS="|"} {print $0,FILENAME}' details.txt
2424|asdsd|121|details.txt
1212|adad|9898|details.txt
12|6767|details.txt
...
64,770
Posted By jaduks
A handy one :-) $ cat daysdiff.sh ...
A handy one :-)

$ cat daysdiff.sh
D1=`date +%s -d "2007-12-19"`
D2=`date +%s -d "2008-02-09"`
((diff_sec=D2-D1))
echo - | awk -v SECS=$diff_sec '{printf "Number of days :...
36,858
Posted By jaduks
A awk one to remove leading 0's $ echo...
A awk one to remove leading 0's

$ echo "0000000231" | awk '{print $1 + 0}'
231
87,072
Posted By jaduks
This can be done using associative array in awk. ...
This can be done using associative array in awk.



$ cat nayan.out
saman 1
gihan 2
saman 4
ravi 1
ravi 2

$ awk '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}' nayan.out >...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy