Search Results

Search: Posts Made By: before4
3,506
Posted By apmcd47
From your usage of date I would guess that you...
From your usage of date I would guess that you are (1) using Gnu utilities and therefore (2) are on a Linux distro and therefore (3) using bash.

Try this:
now=$(date +"%s")
echo "NOW = ${now}";...
3,506
Posted By Scrutinizer
This is double command substitution (both ` ... `...
This is double command substitution (both ` ... ` and $( ... ) plus the first dollar sign should not be there:



Try:
fdate=$(date -d "$in" +"%s")
3,195
Posted By RavinderSingh13
Hello before4, Could you please try...
Hello before4,

Could you please try following and let me know if this helps you, though following is not giving miliseconds at last, though I am working on it to get it done. Let me know how it...
1,894
Posted By RudiC
Try alsoawk ' $1 - prev != 1 {printf "%s%s%s...
Try alsoawk '
$1 - prev != 1 {printf "%s%s%s ", first==prev?"":prev, MRS, $1
first = $1
MRS = RS
}
{prev = $1
...
1,894
Posted By pravin27
Hi , Try new code from post #6. Thanks ...
Hi ,
Try new code from post #6.

Thanks
Pravin
1,894
Posted By RavinderSingh13
Thanks Pravin for pointing out the same. ...
Thanks Pravin for pointing out the same.

Hello before4,

Apologies for not being perfect previous time. Could you please try following and let me know if this helps you.

awk...
1,894
Posted By pravin27
RavinderSingh13, One doubt here , why 179 183...
RavinderSingh13,
One doubt here , why 179 183 is in your o/p
o/p in the post of before4 does not include it.
Little modification if you want to exclude 179 183
awk 'NR==1{first=$0;prev=$0;next }...
1,894
Posted By RavinderSingh13
Hello before4, Not sure how 171 179 is...
Hello before4,

Not sure how 171 179 is coming as after 176 I couldn't see any thing continuous there. So if that is not the case then following may help you in same.

awk...
1,145
Posted By Don Cragun
You could also try: awk -F'; [^ ]*'...
You could also try:
awk -F'; [^ ]*' '{sub(/[^:]*$/,"00",$1);sub(/;$/,x)}1' OFS=, file
which also produces the same output.
Note that we're all assuming that the OP doesn't mind having a space in...
1,145
Posted By RavinderSingh13
Thank you RudiC for pointing out same(Fan of...
Thank you RudiC for pointing out same(Fan of you). Just edited a little to code to get the same output.

awk -F"; " '{gsub(/......$/,"00",$1);for(i=2;i<=NF;i++){gsub(/.*...
1,145
Posted By RudiC
Wasn't the request to set the seconds to zero?...
Wasn't the request to set the seconds to zero? Try awk '{gsub(/; [^ ]* /,", "); sub(/:[^:,]*,/,":00,"); sub (/;$/,"")}1' file
19:08:00, 74598, 1366, 227, 389, 572, 2228, 1039, 25
19:08:00, 75589,...
1,145
Posted By RavinderSingh13
Hello before4, Following may help you in...
Hello before4,

Following may help you in same.

awk -F"; " '{gsub(/....$/,X,$1);for(i=2;i<=NF;i++){gsub(/.* /,X,$i);gsub(/\;$/,Y,$i)}}1' OFS=", " Input_file


Output will be as follows.
...
984
Posted By radoulov
awk -F, 'END { for (e in cnt) print e,...
awk -F, 'END {
for (e in cnt)
print e, cnt[e]
}
{ cnt[$1 FS $2]++ }
' OFS=, infile
984
Posted By radoulov
You may try something like this: awk -F, '{...
You may try something like this:
awk -F, '{ print > ($2 ".txt") }' infile Note that some awk implementations (or some system settings) could limit the number of concurrently open files.
2,016
Posted By RudiC
a) the filenames seem to be created in 10 min...
a) the filenames seem to be created in 10 min increments, not hours
b) the file name format specifier you give does not fit the file names, at least one "m" is missing
c) the results of a thorough...
Forum: UNIX and Linux Applications 02-12-2013
2,843
Posted By DGPickett
What is really slick is a RDBMS with partitioned...
What is really slick is a RDBMS with partitioned tables, so removing and adding are fast and simple. You can name and recycle the same partitions for the 31 days. If the primary key is time or insert...
2,628
Posted By Scrutinizer
Yes, the previous solution only works if the...
Yes, the previous solution only works if the empty line between the records is completely empty (two linefeeds).
Try this instead:
awk -F '=[ \t]*' '$1~/Name/{p=$2;if(getline)p=p OFS...
2,628
Posted By ygemici
# awk -vfs=',' 'BEGIN{printf...
# awk -vfs=',' 'BEGIN{printf "%s%s%s\n","Name"fs,"Address"fs,"Phone";}{
if($0!~/^ *$/) a[++x]=$NF;else b[x]=x-1};END{for(i=1;i<=x;i++)if(i-1==b[i]&&b[i]!=0||i==x)printf "%s\n",a[i];
else{printf...
10,592
Posted By guruprasadpr
Assuming your 7th field in the csv file does not...
Assuming your 7th field in the csv file does not contain any white space:


awk 'OFS=":"{print FILENAME,substr($7,1,8),substr($7,9,2),substr($7,11,2),substr($7,13,2)} FS=, CSV_d.* | sort |uniq
...
Showing results 1 to 19 of 19

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