Search Results

Search: Posts Made By: vgersh99
797
Posted By vgersh99
you'll have work on your logic (I'll leave it as...
you'll have work on your logic (I'll leave it as an exercise for you), but your modified attempt is:

awk -F'|' 'FNR>1 && NF==2{
if ($2 ~ "^ *UP *$")
print "Node" $1 "is" $2 ;...
941
Posted By vgersh99
if you have access to gawk, check man gawk and...
if you have access to gawk, check man gawk and search for FIELDWIDTHS.
if not, you can simulate FIELDWIDTHS yourself.
1,316
Posted By vgersh99
worked just fine with my test harness files...
worked just fine with my test harness files quoted previously!
1,316
Posted By vgersh99
this is gawk specific AND it does not count the...
this is gawk specific AND it does not count the unique lines correctly.
How about another version:

gawk '{l[$0]++} ENDFILE {for (i in l) {if (l[i]==1) u++;t+=l[i]} print t, u, FILENAME; delete l;...
1,316
Posted By vgersh99
how about this: #!/bin/ksh wc -l * |...
how about this:

#!/bin/ksh

wc -l * | sed '$d' | sort | while read lines file junk
do
echo $lines $(sort < $file | uniq -u |wc -l) $file
done
2,260
Posted By vgersh99
nawk on Solaris doesn't support regex or...
nawk on Solaris doesn't support regex or non-single char as RS. In other words, only single chars for RS.

You can try your attempt with Solaris' /usr/xpg4/bin/awk
The alternative (not tested as...
535
Posted By vgersh99
somewhat hard to underhand the "ask", but.... ...
somewhat hard to underhand the "ask", but....
Have you tied searching these forums?
Also look at the bottom of this thread for hints in the "More UNIX and Linux Forum Topics You Might Find Helpful"...
1,350
Posted By vgersh99
I don't quite follow what you're after. Could...
I don't quite follow what you're after.
Could you try to elaborate one more time, please.
A sample input and output could help as well.
222
Posted By vgersh99
I had the same issue/question awhile back... ...
I had the same issue/question awhile back...
After a bit of digging, I installed mksh which "links/hides" itself as ksh:

$ which ksh
/usr/bin/ksh

$ ls -lrt /usr/bin/ksh
lrwxrwxrwx 1...
2,551
Posted By vgersh99
MY_DIR="/storage/tmp" awk -v myDir="${MY_DIR}"...
MY_DIR="/storage/tmp"
awk -v myDir="${MY_DIR}" '{if ($1 == "aaa") out=(myDir "/group_a.gtf"); else if ($7 == "bbb") out=(myDir "/group_b.gtf"); print >> out;close(out)} ' infile
2,796
Posted By vgersh99
what makes row 2 different from row 1? Please...
what makes row 2 different from row 1?
Please be more specific with your requirements....
2,246
Posted By vgersh99
DJR, this is not what I suggested and not how...
DJR,
this is not what I suggested and not how to assign/use/display local vs remote vars - please reread my original post.

filepath=/xxx/yyy/zzz/
filename=xyz

ssh -q uid@hostname " \
. \
....
2,246
Posted By vgersh99
either: filepath=/xxx/yyy/zzz/ filename=xyz ...
either:
filepath=/xxx/yyy/zzz/
filename=xyz

ssh uid@hostname << ENDSSH
.
.
if [[ -e \${filepath}\${filename} ]]; then
....
....
fi

ENDSSH


or


filepath=/xxx/yyy/zzz/...
89
Posted By vgersh99
if you searched for transpose you'd have found a...
if you searched for transpose you'd have found a couple of leads...
awk -F, -f bomb.awk OFS=, myFile where bomb.awk is:

{for(i=1;i<=NF;i++){a[i,NR]=$i};m=NF;n=NR}
END {
for(j=1;j<=m;j++)
...
426
Posted By vgersh99
how about a brute-force approach - YMMV: ...
how about a brute-force approach - YMMV:

awk -F'["<>]' '$5=="vin" {print $3, $9, $13}' OFS=, myFile.txt
1,827
Posted By vgersh99
My previously posted attempt was for the provided...
My previously posted attempt was for the provided sample files ONLY - 2 lines for each sequence: 1 header and 1 "data" lines.
Had the OP elaborated on the possible other sample data files, an...
1,827
Posted By vgersh99
not sure if I follow your samples and the desired...
not sure if I follow your samples and the desired output, but I think you might want this.

awk -f dinesh.awk file2 file1 where dinesh.awk is:

FNR==NR {
if (FNR%2)
head=$0
else
...
1,746
Posted By vgersh99
Just to quote RudiC: A desired output would...
Just to quote RudiC:

A desired output would be helpful as well....
Also, you've been asked to start using code tags when posting code/data sample...
1,575
Posted By vgersh99
actually (I think) it should be - depending on...
actually (I think) it should be - depending on how "strict" your definition/goal is - pick your poison :

BEGIN {
FS=OFS=","
}
{
t2[$2]=$1
t3[$3]=$1
t3t[$1]=$3
}
END {
for (i...
1,575
Posted By vgersh99
a bit of a "shot in the dark - different results...
a bit of a "shot in the dark - different results as I believe the description doesn't jive with the sample data.
awk -f bleed.awk myFile where bleed.awk is:

BEGIN {
FS=OFS=","
}
{
...
1,914
Posted By vgersh99
man grep yields: -F, --fixed-strings...
man grep yields:

-F, --fixed-strings
Interpret PATTERN as a list of fixed strings (instead of regular
expressions), separated by newlines, any of which is...
1,865
Posted By vgersh99
eklinux, please post the complete cli that you...
eklinux,
please post the complete cli that you used to create the myFile.tar.gz file.
Also post the output of tar tvf myFile.tar.gz using code tags.
Also provide the cli you to untar commend you...
1,865
Posted By vgersh99
This is way too vague of a request. Define...
This is way too vague of a request.
Define "nothing happens" and share your tar cfvz.
1,792
Posted By vgersh99
Don't think we can help you unless you answer the...
Don't think we can help you unless you answer the previous question in the detailed way.
Thanks
1,538
Posted By vgersh99
how about for starters... awk -F, -v...
how about for starters...
awk -F, -v sd='01/02/2015' -f old.awk myFile where old.awk is:

function conv(d, t) {
split(d, t, "/")
return (sprintf("%d%.02d%.02d", t[3], t[1], t[2]))
}...
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy