Search Results

Search: Posts Made By: jacobs.smith
7,591
Posted By RudiC
That specification is not too clear. If I...
That specification is not too clear. If I interpreted it correctly, try
awk 'NR == FNR {T["\"" $1 "\";"] = $2; next} $12 in T {sub ($12 ".$", "& " T[$12])} 1' file2 file1
7,591
Posted By Scrutinizer
Not sure what you mean exactly. Perhaps something...
Not sure what you mean exactly. Perhaps something like this?
awk 'NR==FNR{A[$1]=$2; next} $2 in A{$2=$4=A[$2]}1' FS='\t' file2 FS=\" OFS=\" file1

Output:...
1,550
Posted By rbatte1
Welcome sunnu2u86 , I have a few to...
Welcome sunnu2u86 ,

I have a few to questions pose in response first:-
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
What are your preferred...
12,401
Posted By Don Cragun
Perhaps we would have a better chance of helping...
Perhaps we would have a better chance of helping you if you told us what operating system successfully runs this third party script. And, it would probably help even more if you told us what output...
24,621
Posted By Akshay Hegde
Try [akshay@localhost tmp]$ cat f col ...
Try


[akshay@localhost tmp]$ cat f
col
1
2
3
4
[akshay@localhost tmp]$ awk 'BEGIN{print "<table>"}{c="td"; e=""}FNR==1{c="th";e=" style=\"color=red;\""}{print...
16,677
Posted By RudiC
OK, try this: awk ' NR==1 {print "Name", $0...
OK, try this:
awk '
NR==1 {print "Name", $0
CC = NF
for (i=1; i<2^CC; i++) Set[i] = 0
next
}
{for (i=1; i<=CC; i++) {T[$i]
...
16,677
Posted By RudiC
Another small refinement: awk ' NR==1 ...
Another small refinement:
awk '
NR==1 {print "Name," $0
CC = NF
for (i=1; i<2^CC; i++) Set[i] = 0
next
}

{for (i=1; i<=CC; i++) {T[$i]
...
16,677
Posted By RavinderSingh13
Hello jacobs.smith, Let's say we have...
Hello jacobs.smith,

Let's say we have following Input_file(which willbe created by your 1st requirement, so I have edited it to test it more).

cat Input_file...
16,677
Posted By RudiC
That's not that easy, as the number of...
That's not that easy, as the number of combinations grows dramatically with increasing set count.
16,677
Posted By RudiC
How about awk ' NR==1 {print "Name", $0 ...
How about
awk '
NR==1 {print "Name", $0
next
}
{for (i=1; i<=3; i++) {T[$i]
R[$i,i] = 1
}
...
16,677
Posted By RavinderSingh13
Hello jacobs.smith, If you are not bothered...
Hello jacobs.smith,

If you are not bothered about sequence of field 1st as per your Input_file then following may help you in same.

awk -F, 'NR==1{print "Name," $0;R=NF}...
1,812
Posted By drl
Hi. Assuming you can use standard commands...
Hi.

Assuming you can use standard commands and do not need quotes on date:
paste -d, - - < test.csv
producing
"url1","abc","project url1",2016-08-16
"url2,"microsoft","project url2",2016-08-18...
16,677
Posted By Yoda
An approach using gawk:- gawk -F, ' ...
An approach using gawk:-
gawk -F, '
NR == 1 {
print "Name," $0
}
NR > 1 {
for ( i = 1; i <= NF; i++ )
{
...
2,218
Posted By Corona688
grep doesn't do that, you can use awk: awk...
grep doesn't do that, you can use awk: awk 'match($0,/hello[a-z]hello/) { print L ; print substr($0,RSTART,RLENGTH); } ; { L=$0 }' input
2,218
Posted By rdrtx1
sed 's/.*\(hello[a-z]hello\).*/\1/' infile
sed 's/.*\(hello[a-z]hello\).*/\1/' infile
2,218
Posted By Corona688
-o and -B are mutually exclusive, -o tells it to...
-o and -B are mutually exclusive, -o tells it to show nothing but the matching text. Remove -o.
2,899
Posted By Don Cragun
Is this a homework assignment? Homework and...
Is this a homework assignment? Homework and coursework questions can only be posted in this forum (https://www.unix.com/homework-coursework-questions/) in a particular format described in special...
7,942
Posted By Don Cragun
Assuming that data values are strings (not...
Assuming that data values are strings (not numbers that need to be converted to a canonical format), and that you want a count of the number of times a string appears in your input file, the...
13,834
Posted By RudiC
Not without way more evidence. ----------...
Not without way more evidence.

---------- Post updated at 09:23 ---------- Previous update was at 09:13 ----------

The averaging error in the last record corrected. Try
paste FILE1 FILE2 | ...
13,834
Posted By RudiC
As I said, I'm braindead. I missed the average,...
As I said, I'm braindead. I missed the average, sorry. Try printing SUM/(L[i+1]-L[i]). That's not OK for the very first entry as the first field is summed, too, as its value is zero, so the element...
13,834
Posted By RudiC
This is a hell of a problem, by sheer data...
This is a hell of a problem, by sheer data volume. I'm brain dead now; can't verify the results are correct although I think/hope they are. Tryawk '
NR == 1 {print "Gene Average_10% ...
13,834
Posted By Don Cragun
I do not understand what output you are trying to...
I do not understand what output you are trying to produce.

For each input gene line do you want:

one output line with the gene number and 10 averages from all 13 samples,
thirteen output...
89,950
Posted By Neo
User Guide: Posting in the Emergency Forum
Emergency UNIX and Linux Support !! Help Me! Forum (Request Urgent Help) (https://www.unix.com/emergency-unix-linux-support-help-me/)

README FIRST: How to Request Emergency or Urgent Help:


...
1,308
Posted By RudiC
How about awk '{T = ($3 - $2)%base; N = $2; while...
How about awk '{T = ($3 - $2)%base; N = $2; while (D < $3) {print $1, N, D = N + T, $4 "" ++C; N = D; T = base}}' base=10 file
chr1 100 105 name1
chr1 105 115 name2
chr1 115 125 name3
chr1 125...
1,088
Posted By jeo_fb
---------- Post updated at 01:59 PM ----------...
---------- Post updated at 01:59 PM ---------- Previous update was at 01:33 PM ----------




Thank you

Does it work in csh script?

I think that foreach command works in csh script
Showing results 1 to 25 of 317

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