Search Results

Search: Posts Made By: nakaedu
2,324
Posted By RudiC
You may want to try awk ' 1 == match ($0,...
You may want to try
awk '
1 == match ($0, "[^ ]") {ORG = $0
}
{IX = index ($0, " ")
...
2,324
Posted By Don Cragun
Building on what you had come up with, try: awk...
Building on what you had come up with, try:
awk -F'[^ ]' '
{ current_len = length($1)
last_len = length(last_line)
len = current_len > last_len ? last_len : current_len
last_line =...
1,097
Posted By rdrtx1
try: awk -F";" ' NR==FNR {a[$4$5]=$0;...
try:
awk -F";" '
NR==FNR {a[$4$5]=$0; f6[$4$5]=$6; next}
a[$4$5] {$6=f6[$4$5];}
1
' OFS=";" file1 file2
2,986
Posted By Yoda
Try this:- sed 's/,//g;s/Bytes//g;s/GB//g;s/...
Try this:-

sed 's/,//g;s/Bytes//g;s/GB//g;s/ //g' input_file | awk -F";" '
BEGIN {
s1=0;
s2=0;
s3=0;
s4=0;
} !/Parent/ {
s1+=$9;
s2+=$10;
...
3,825
Posted By RudiC
Yes, you are right, but exponentiation is even...
Yes, you are right, but exponentiation is even more CPU intensive than multiplication.
14,528
Posted By RudiC
It will work with slight corections:awk -F ";" ...
It will work with slight corections:awk -F ";" -v OFS=";" '
function GSUB( F ) {gsub(/\./,",",$F)}
GSUB( 6 )
GSUB( 7 )
GSUB( 8 )
1
' If you wanted the OFS to...
3,825
Posted By elixir_sinari
Like this? awk -F\; '{t=$9;gsub(/,/,"",t);$9=$9...
Like this?
awk -F\; '{t=$9;gsub(/,/,"",t);$9=$9 " (" (t/1024/1024/1024) " GB)"}1' CONVFMT='%.6f' OFS=\; file
3,825
Posted By pamu
First remove all the strings and , from the $9. ...
First remove all the strings and , from the $9.

use

awk -F ";" '{ gsub("[A-z]","",$9);gsub(",","",$9); print $9/(1024*1024*1024)}' file
3,825
Posted By elixir_sinari
awk -F\; '{gsub(/,/,"",$9);$9=($9/1024/1024/1024)...
awk -F\; '{gsub(/,/,"",$9);$9=($9/1024/1024/1024) " GB"}1' CONVFMT='%.6f' OFS=\; file
10,187
Posted By Scrutinizer
Or to remove multibyte characters, you could try:...
Or to remove multibyte characters, you could try:
LANG=C tr -d '[\200-\377]' < infile
10,187
Posted By Chubler_XL
Can you paste the output of head -1 file1 | od -c...
Can you paste the output of head -1 file1 | od -c for us so we can see the exact byte codes you have in this file.
10,187
Posted By RudiC
In principle not too difficult:$ sed 's/^´╗┐//'...
In principle not too difficult:$ sed 's/^´╗┐//' file1, but you should be aware that these character graphics chars usually belong to a multibyte character set like utf-8 or so which may impose...
1,881
Posted By raj_saini20
awk -F"\"" '/^share/{n=split($NF,a,"=");print...
awk -F"\"" '/^share/{n=split($NF,a,"=");print "\\"a[n]"\\"$2","$4}' filename
1,881
Posted By agama
This makes some assumptions about the input (like...
This makes some assumptions about the input (like netbios= always being the last on the line), but might work:


awk -F '"' '
/share/ {
n = split( $0, a, "=" );
printf(...
4,498
Posted By radoulov
You may notice that my code was formatted...
You may notice that my code was formatted differently (the new lines matter).
If you want to write it on a single line, you'll need to use a semi-colon:

_0 = tolower($0); if (NR == FNR) A[_0];...
Showing results 1 to 15 of 15

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