Search Results

Search: Posts Made By: SriniShoo
1,892
Posted By SriniShoo
try this awk '1' ORS='\r\n' | mailx -s "Sending...
try this
awk '1' ORS='\r\n' | mailx -s "Sending mail" mailed
code error in the above.
awk '1' ORS='\r\n' temp.txt | mailx -s "Sending mail" mailed
1,229
Posted By SriniShoo
slight modification to Yoda's approach to not...
slight modification to Yoda's approach to not print duplicates for each set in the output
awk '$1==10{split("",A);next}++A[$1]==2' file
1,348
Posted By SriniShoo
awk 'NR == FNR {a[$1] = $3; next} {print $1,...
awk 'NR == FNR {a[$1] = $3; next} {print $1, (a[$1] == "" ? "nomatch" : a[$1])}' file2 file1
1,849
Posted By SriniShoo
Sorry! That was untested and there was a bug ...
Sorry! That was untested and there was a bug
try below
awk -F ';' '
FILENAME == ARGV[1] {A[$1] = ($2 ";" $3); next}
FILENAME == ARGV[2] {A[$2] = A[$2] == "" ? (";;" $1) : (A[$2] ";" $1);...
981
Posted By SriniShoo
#!/bin/ksh while read user do while read...
#!/bin/ksh
while read user
do
while read proj nm
do
echo "Delete user profile \"${user}\" FROM ${proj} ${nm}"
done < file2
done <file1 > OP1

Ignore this..I haven't seen the...
1,849
Posted By SriniShoo
awk -F ';' ' FILENAME == ARGV[1] {A[$1] = ($2...
awk -F ';' '
FILENAME == ARGV[1] {A[$1] = ($2 ";" $3); next}
FILENAME == ARGV[2] {A[$2] = A[$2] == "" ? (";;" $1) : (A[$2] ";" $1); next}
FILENAME == ARGV[3] {A[$1] = A[$2] == "" ? (";;;" $2...
2,465
Posted By SriniShoo
awk 'NR == FNR {a[$0]; next} {if(! (FNR in...
awk 'NR == FNR {a[$0]; next}
{if(! (FNR in a)) {print}}' list.txt main.txt
Forum: Red Hat 11-07-2014
1,486
Posted By SriniShoo
I dont think you can change a file to a directory...
I dont think you can change a file to a directory of vice versa.
you can create a directory with name 'maddy' and move the file into that with the below code
mv maddy maddy_01 && mkdir maddy && mv...
2,160
Posted By SriniShoo
awk -F ',' 'NR == 1{for(i=1; i<=NF; i++) a[$i] =...
awk -F ',' 'NR == 1{for(i=1; i<=NF; i++) a[$i] = i; next}
$0 ~ "^" proxy {print $(a[field])}' proxy="main,FRONTEND" field="slim" socat.txt
2,160
Posted By SriniShoo
awk -F ',' 'NR == 1{for(i=1; i<=NF; i++) a[$i] =...
awk -F ',' 'NR == 1{for(i=1; i<=NF; i++) a[$i] = i; next}
/^main,FRONTEND/ {print $(a["slim"])}
/^apache2,elb4/ {print $(a["ereq"])}' socat.txt
6,303
Posted By SriniShoo
awk '{a[$1] += $2; b[$1] += $3; c[$1] += $4;...
awk '{a[$1] += $2; b[$1] += $3; c[$1] += $4; d[$1] += $5; e[$1] += $6} END {for(x in a) print x, a[x], b[x], c[x], d[x], e[x]}' file

---------- Post updated at 09:50 AM ---------- Previous update...
Forum: What is on Your Mind? 10-08-2014
27,515
Posted By SriniShoo
Mark, highlight and make the answer appear just...
Mark, highlight and make the answer appear just below the question so that other users can easily find solution without having to look at entire post / multiple pages of the post and still not able...
1,371
Posted By SriniShoo
awk '/^[^:]*:$|^[ \t]*$/{f=0} /^Clinical...
awk '/^[^:]*:$|^[ \t]*$/{f=0} /^Clinical features:$|^Inheritance pattern:$/{f=1}f' genedx156.txt > output.txt
9,545
Posted By SriniShoo
What have u tried?
What have u tried?
2,194
Posted By SriniShoo
awk -F '\t' 'NR == FNR{if(NR == 1) {for(i=2;...
awk -F '\t' 'NR == FNR{if(NR == 1) {for(i=2; i<=NF-1; i++) H[i]=$i; next};
for(i=2; i<=NF-1; i++) if($i == "Yes")
A[$1] = (A[$1] == "") ? H[i] : (A[$1] "," H[i]); B[$1] = $NF; next}
{print...
920
Posted By SriniShoo
Below code will append the below given 2 lines of...
Below code will append the below given 2 lines of data into the file FILE_PATH
FILE_PATH='/tmp/sample.txt'
cat - << 'EOF' >> ${FILE_PATH}
This is sample data in the file
Check the data
EOF

...
1,406
Posted By SriniShoo
@RudiC code with better performance awk...
@RudiC code with better performance

awk 'BEGIN {for(i=1; i<=1000000; i++) t = (t " 0")} {printf "%s%s\n", $0, t}' file1 > file2
976
Posted By SriniShoo
awk 'FNR == 1 {nm=substr(FILENAME,...
awk 'FNR == 1 {nm=substr(FILENAME, length(FILENAME)-11, 8)} {print nm "|" $0}' *.xls
2,397
Posted By SriniShoo
you can change the value of t to wharever time...
you can change the value of t to wharever time you wanted to grep
awk '$0 ~ ("^Time = " t "$") {getline;
for(i=1; i<=NF; i++)
{if($i ~ /^ExecutionTime$/) et=($(i+2) " " $(i+3))
else if($i ~...
5,744
Posted By SriniShoo
awk 'NR == FNR {a[$1]; next} {for(x in a) {if($0...
awk 'NR == FNR {a[$1]; next} {for(x in a) {if($0 ~ "(^||)" x "(||$)") {a[x]++; next}}} END {for(x in a) print x, a[x]}' file1 file2
3,176
Posted By SriniShoo
awk 'NR == FNR{split($0, t, /[$][$][$]/); a[t[1]]...
awk 'NR == FNR{split($0, t, /[$][$][$]/); a[t[1]] = t[2]; next} /<value>/ {split($0, t, />|</); v=t[3]} /<password-encrypted>/ {sub(/>.*<\//, ">" a[v] "</")}1' passwd file

for the modified passwd...
2,084
Posted By SriniShoo
awk '{id=$1; email=$NF; $1=$NF=""; $0 = $0; $1 =...
awk '{id=$1; email=$NF; $1=$NF=""; $0 = $0; $1 = $1; name=$0; print "$id=" id; print "$name=" name; print "$email=" email}' file
1,246
Posted By SriniShoo
in addition to what Chubler_XL has suggested, you...
in addition to what Chubler_XL has suggested, you could change the prints in if else conditions as below
else if ((V[i] == V[i+1]) && (V[i+1] > 0))
print R[i], (V[i+1] - V[i])
## You could...
2,454
Posted By SriniShoo
awk -vg="${GOODNUMBERS}" -vb="${BADNUMBERS}"...
awk -vg="${GOODNUMBERS}" -vb="${BADNUMBERS}" 'BEGIN{n=split(g, a); for(i=1; i<=n; i++) {if(b !~ "(^| )" a[i] "($| )") print a[i]}}'

---------- Post updated at 04:28 AM ---------- Previous update...
19,641
Posted By SriniShoo
awk -F ';' '$13 == "ASD" {print > ("ASD.txt");...
awk -F ';' '$13 == "ASD" {print > ("ASD.txt"); next} {print > ("REST.txt")}' input_file
Showing results 1 to 25 of 145

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