Search Results

Search: Posts Made By: kylle345
1,709
Posted By Aia
Please, post some more information that might...
Please, post some more information that might help in the process of troubleshooting.
i.e
What program are you running?
How are you running the program?:

show the full command you are...
1,640
Posted By kidSandy
I have modified the script on the same below...
I have modified the script on the same below link, OR condition(|) was missing for one of the statement - copy paste type error, apologies for the same. Tested working very well
Perl - Need a Perl...
1,640
Posted By Aia
#!/usr/bin/perl use strict; use warnings; ...
#!/usr/bin/perl

use strict;
use warnings;

# map relationships to gender.
# accommodate misspelling of Daughter
my %gender = (
'Father', '[M]',
'Mother', '[F]',
'Daugther',...
1,640
Posted By Don Cragun
Here is a slightly different approach to the...
Here is a slightly different approach to the problem using awk. Note that the sample input file in post #1 in this thread sometimes uses <tab>, sometimes uses <tab> and a few <space>s, and sometimes...
1,640
Posted By RudiC
How about this awk script:awk -F"\t" ' BEGIN ...
How about this awk script:awk -F"\t" '
BEGIN {A="FSMDC"
B="MMFF"
C="PCPCC"
for (i=1; i<=5; i++) {GEN[substr(A,i,1)]=substr(B,i,1)
...
1,640
Posted By kidSandy
I have posted Perl code you are looking in the...
I have posted Perl code you are looking in the below link, can refer the same
Perl - Need a Perl code for the below input and output...
1,640
Posted By RudiC
How come Jane Smith is an [F] - there's no...
How come Jane Smith is an [F] - there's no daugther in that case. And why [Ralph Davis][F] - there's just one child?
1,640
Posted By Don Cragun
You have shown us the output you want when the...
You have shown us the output you want when the input has two parents and one child, and you have shown us the output you want when the input has one parent and more than one child. What output do...
2,287
Posted By Just Ice
see man head and man tail ... head -n 1000...
see man head and man tail ...

head -n 1000 infile > outfile1
tail -n 1000 infile > outfile2
1,429
Posted By yogendra.barode
you can try following command on shell for...
you can try following command on shell

for i in `ls -1 *.jpy.jpeg`; do FN=`echo $i|cut -d"." -f1`; mv $i "$FN.hhk.jpeg"; done
1,429
Posted By complex.invoke
for i in *.jpeg; do mv "${i}"...
for i in *.jpeg; do
mv "${i}" "${i/jpy/hhk}"
done

or

rename jpy hhk *.jpeg
1,152
Posted By Scrutinizer
Could it be that the empty field is not the last...
Could it be that the empty field is not the last field?
awk -F'\t' -v f=file1 '$5==""{print>f; next}1' infile > file2
2,516
Posted By Corona688
awk '{ M=NF; for(N=4; N<=NF; N++) T[N]+=$N } ...
awk '{ M=NF; for(N=4; N<=NF; N++) T[N]+=$N }
END {
printf("%f", T[4]/NR);
for(N=5; N<=M; N++) printf("\t%f", T[N]/NR);
printf("\n");
}' filename
1,087
Posted By agama
This should do it based on your sample: ...
This should do it based on your sample:


awk '
s"" != $2 { # s"" handles the case where $2 is 0 on the first record
if( NR > 1 )
printf(...
858
Posted By vgersh99
sorry, I misunderstood what you were after... ...
sorry, I misunderstood what you were after...
kyl.awk:

FNR==1 { h=$0;f++;next}
NR==2 {f3=$1 OFS $2 OFS $3}
{for(i=4;i<=NF;i++) s[FNR,i]+=$i; nf=NF;fnr=FNR}
END {
print h
for...
858
Posted By vgersh99
nawk -f kyl.awk OFS='\t' file1 file2 file3 fileN ...
nawk -f kyl.awk OFS='\t' file1 file2 file3 fileN
kyl.awk:

FNR==1 { h=$0;next}
NR==2 {f3=$1 OFS $2 OFS $3}
{for(i=4;i<=NF;i++) s[i]+=$i; nf=NF;nr=NR}
END {

printf h ORS f3 OFS
...
1,061
Posted By Scrutinizer
Hi, try this: awk '!A[$1]++' ORS=', ' infile |...
Hi, try this:
awk '!A[$1]++' ORS=', ' infile | sed 's/, $/\n/'
-same solution ;) -
1,061
Posted By Corona688
$ awk 'BEGIN { ORS=", " } !A[$1]++' < data HI,...
$ awk 'BEGIN { ORS=", " } !A[$1]++' < data
HI, Joe, Bob, Jack,
$

First, we set ORS=", " so it prints ", " instead of \n for each "line".

The next is an expression telling it when to print. ...
8,880
Posted By agama
I think a simple sort unique will work: ...
I think a simple sort unique will work:


sort -u file1 file2
1,260
Posted By yazu
It's very easy with sed or perl or awk. Why don't...
It's very easy with sed or perl or awk. Why don't try it yourself?

By the way, you've got an interesting statistics. You ask questions (a lot), get answers and:

Posts: 79
Thanks: 0
1,260
Posted By ltomuno
sed 's/^[0-9]*//;s/:/ /;s/</ /;s/,/ /g' inputfile...
sed 's/^[0-9]*//;s/:/ /;s/</ /;s/,/ /g' inputfile | awk '{NF-=1;print}'
1,260
Posted By Peasant
sed "s#+:<#\t#g" Regards Peasant. ...
sed "s#+:<#\t#g"


Regards
Peasant.

(sorry yazu didn't see the post)
Showing results 1 to 22 of 22

 

Featured Tech Videos

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