Search Results

Search: Posts Made By: senhia83
3,895
Posted By senhia83
Either of these patches might work, although...
Either of these patches might work, although there are smarter ways

awk '{a[$2$3]++; b[$2$3]=$0}END{for(as in a) if(a[as]==1) print b[as]}' infile | sort -k2,2n

awk '{a[$2$3]++;...
3,895
Posted By senhia83
If order is not important awk '{a[$3]++;...
If order is not important

awk '{a[$3]++; b[$3]=$0}END{for(as in a) if(a[as]==1) print b[as]}' infile

M4 1 3456
M8 2 7889
M5 2 456
3,153
Posted By senhia83
one way below using split, other methods include...
one way below using split, other methods include parsing by regex..

try

awk -F"\t" '{split($10,a,";"); for (i=1;i<=length(a);i++) if (a[i]~/gene_name/) { split(a[i],b,"\"");x=b[2] } else if...
3,765
Posted By senhia83
Close awk 'NR%2{printf $0" ";next;}1'...
Close

awk 'NR%2{printf $0" ";next;}1' file
2,085
Posted By senhia83
Adapted from a similar solution on this forum ...
Adapted from a similar solution on this forum


awk 'NR>1{LN[$4]; HD[$5]; MX[$4,$5]=$2}
END { printf "%8s", ""; for (i in HD) printf "%8s", i; print "";
...
2,317
Posted By senhia83
please use code tags from now.. can you see the...
please use code tags from now..
can you see the extra tabs in your data?

Removing tabs with a pipe should give you unique list

cut -d'|' -f4 emp.1st | sed 's/\t//g' | sort -u
1,893
Posted By senhia83
This looks like a simple case of paste paste...
This looks like a simple case of paste

paste -d";" file* > output_combined
4,127
Posted By senhia83
try awk -F, ' ...
try

awk -F, '
{a[$1","$2]=a[$1","$2]?a[$1","$2] OFS $3:$3}
END{for (i in a) print i FS a[i]}
' OFS=";" file
3,343
Posted By senhia83
care to give an example of what you are looking...
care to give an example of what you are looking for? exact input and exact output samples would help.
9,351
Posted By senhia83
Try, untested awk -v x=0 '(NR == FNR) {...
Try, untested

awk -v x=0 '(NR == FNR) { if(length > x) x = length;next } { printf("%-"x"s\n", $0) }' file file
2,525
Posted By senhia83
A crude way, I`m sure there is better solution ...
A crude way, I`m sure there is better solution

awk -F"X" 'NR==1{$0= $0" D"} NR>1{ $0=$0" "NF}1' infile| awk 'NR<2{print $0;next}{print $0| "sort -nk4,4"}' | awk '{print $1,$2,$3}'
886
Posted By senhia83
this might work? untested.. find . -name...
this might work? untested..

find . -name "*.properties" | while read line
do
./operation.sh 775 "$line"
done
6,328
Posted By senhia83
I will do this in 3 steps. 1. Extracting the...
I will do this in 3 steps.

1. Extracting the first column from any of the files, add a blank line and store in a file.
awk 'NR==1{print ""} {print $1}' file1 > ../tmpcol1


2. Paste all col2...
1,260
Posted By senhia83
In your old directory (dir1) mkdir ../newdir...
In your old directory (dir1)

mkdir ../newdir

for file in *
do
awk '$20<40' $file > ../newdir/$file
done


Note that newdir will be same level as your olddir
1,255
Posted By senhia83
Try awk -F";" '$4=="02"{ sum+=$(NF-1)} END...
Try

awk -F";" '$4=="02"{ sum+=$(NF-1)} END {print sum}' Input_file > Sum.txt

Please decide what your requirement is before posting, anyways,, for your latest req

awk -F";" '$4$5=="022015"{...
1,255
Posted By senhia83
another solution awk -F";" '{ sum+=$(NF-1)}...
another solution

awk -F";" '{ sum+=$(NF-1)} END {print sum}' Input_file > Sum.txt
2,731
Posted By senhia83
How about now awk '{split($4,a,":"); if...
How about now

awk '{split($4,a,":"); if (a[1]>=24) print}'
2,995
Posted By senhia83
maybe this will work too? awk '/^\(/...
maybe this will work too?

awk '/^\(/ {sub(/\(/,"");sub(/\)/,"")}1' infile
1,590
Posted By senhia83
Can you try this? I remember pulling this...
Can you try this?

I remember pulling this from the internet a long time ago, though never used it.

awk -vq='"' '
func csv2del(n) {
for(i=n; i<=c; i++)
{if(i%2 == 1) gsub(/,/, OFS,...
4,194
Posted By senhia83
Hi Don, I`m getting the the following result...
Hi Don,

I`m getting the the following result when I run the code in cygwin

$ cat tmp
a.sh start time is Fri Jan 9 17:17:33 CST 2015
a.sh end time is Fri Jan 9 17:47:33 CST 2015
Single...
5,369
Posted By senhia83
Not tested, but maybe some form of the following...
Not tested, but maybe some form of the following might work ? Please try on a dummy set first..
Waiting on a second opinion

find /TGTDIR/ -maxdepth 1 -type -d -name '*' -print0 | xargs -r0 ls -t...
4,370
Posted By senhia83
I want to edit the sample input slightly to...
I want to edit the sample input slightly to accommodate NA missing values, and remove the leading spaces. For a finite number of columns you can of course use arr1, arr2, arr3 etc like you have used...
4,089
Posted By senhia83
How about this awk 'NR==FNR { a[$0]; next }...
How about this

awk 'NR==FNR { a[$0]; next } { for (i in a) print i, $0 }' prefix root


A slower bash solution , perhaps easier to follow

while read a;
do
while read b;
do
echo "$b...
1,609
Posted By senhia83
Another solution with awk, $ cat tmp ...
Another solution with awk,

$ cat tmp
0x000000 0x5a80 0x0060 BRA.l 0x60 ;file:UserCall.s ;function:_user_call_table ;C_sourceLine:24
0x000002 0x1bc5 RETI ;file:UserCall.s...
2,047
Posted By senhia83
I wont be able to help in perl, maybe this will...
I wont be able to help in perl, maybe this will help

awk -F"=" '{print $1}' dictionary_file | sort | uniq -c | awk '{print $2 >> "numrepeats_"$1"_list"}'



This will spit out as many files...
Showing results 1 to 25 of 45

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