Search Results

Search: Posts Made By: shunya
2,898
Posted By rdrtx1
gsub("[^0-9]", "") # eliminate all non-digits ...
gsub("[^0-9]", "") # eliminate all non-digits

if (! c[$NF]) CHR=CHR $NF ","
c[$NF]=$NF # if last field was not stored in c array then add to CHR string (eliminate duplicates)

Better yet,...
2,898
Posted By Don Cragun
There is no reason to use cat to feed data to...
There is no reason to use cat to feed data to awk; awk is perfectly capable of reading files on its own. Using cat causes all of the data to be read and written an extra time, consumes more system...
2,898
Posted By rdrtx1
awk 'BEGIN { printf ("%-40s %-5s %-15s\n",...
awk 'BEGIN {
printf ("%-40s %-5s %-15s\n", "File Names","Lines", "CHARS")
printf ("%-40s %-5s %-15s\n", "--------------","-----","------")
}

$NF ~ /\(File\)/ {
CSG=CSG $(NF-1) ","
}...
2,561
Posted By RudiC
OK, there's the error. Try awk -vDT=$(date +%s)...
OK, there's the error. Try
awk -vDT=$(date +%s) 'BEGIN {D10 = (DT-864000); split ("OLDER YOUNGER", FN)} {print $0 ">" (FN[1+($2/1E9 > D10)])} ' file
2,561
Posted By RudiC
Sorry, I forgot to remove the "test setup" -...
Sorry, I forgot to remove the "test setup" - remove the double quotes around the redirection operator.
5,706
Posted By rovf
If it waits for the full 30 minutes, it means...
If it waits for the full 30 minutes, it means that expect does not see the string you are waiting for.

You are writing
expect -exact "(.*)## $"

which means that you are waiting for the string...
5,333
Posted By Corona688
You can make your script a lot simpler by using...
You can make your script a lot simpler by using more of the shell's own basic features. You can split input on fields in shell without the help of awk, sed, and tr. You can write to the same file...
1,471
Posted By RudiC
Difficult to believe you get that output ... ...
Difficult to believe you get that output ...
How about
cut -c7-51,74- file
Name ver FLRGT Start Time End Date
-------- --- ------ ---------------------------...
2,008
Posted By RudiC
Try also awk ' {gsub (/[ ...
Try also
awk '
{gsub (/[ ]+/, " ")
DL = ""
}
!/^[ ]+/ {sub (/ /, " ")
DL = RS
}
...
2,008
Posted By Don Cragun
Try: awk ' BEGIN { FS = ",[[:space:]]*" ...
Try:
awk '
BEGIN { FS = ",[[:space:]]*"
OFS = ","
}
/^[^[:space:]]/ {
if(NR > 1)
print ""
for(i = 1; i <= NF; i++)
if($i != "")
printf("%s%s", $i, OFS)
next
}...
Showing results 1 to 10 of 10

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