Search Results

Search: Posts Made By: jdhahbi
1,641
Posted By jdhahbi
thank you for your help. Joseph
thank you for your help.
Joseph
1,641
Posted By jdhahbi
extract specific rows
Hi
I have a file that looks like the one below.
For the same 'TCONS' in the second column, I would like to extract the row that has the highest (or last) number in the fourth column.
Any kind of...
997
Posted By jdhahbi
help with grep
Hi
I use the following code quite a bit; however, it can be very slow when the pattern list reaches a few thousands. Is there a faster alternative?
Thanks
grep -w -f pattern_file actual_file
1,024
Posted By jdhahbi
thank you. Ruby is good too.
thank you. Ruby is good too.
1,024
Posted By jdhahbi
thank you. It works.
thank you. It works.
1,024
Posted By jdhahbi
find and replace
I have a tab-delimited inFile:
cat inFile
A B C D E F
1 2 3 4 5 6
a b c d e fI would like to replace the first 3 tabs in each row with underscore to...
1,758
Posted By jdhahbi
This code works well. Thank you
This code works well.
Thank you
1,758
Posted By jdhahbi
I am not really sure I understand the question. ...
I am not really sure I understand the question.
can you please explain a bit more?
Thanks
Joseph
1,758
Posted By jdhahbi
I tested the code with the following inFile: ...
I tested the code with the following inFile:

#f1 f2 f2
a 3991037 4155442
a 3993760 4160837
a 3994154 4159990
b 308568 179762
f 3484774 3488370
f ...
1,758
Posted By jdhahbi
print average of duplicates
Hi
my inFile has 3 fields with duplicates in field1.
I would like to print the average field2 and field3 for the duplicated field1.

$cat inFile
f1 f2 f3
A 7 2
B 4 2
B 2...
16,192
Posted By jdhahbi
it worked. Thank you and have a wonderful week!
it worked.
Thank you and have a wonderful week!
16,192
Posted By jdhahbi
this works fine with the test file I posted, but...
this works fine with the test file I posted, but it does not seem to work with my actual data as shown below:

$cat s5
#miRNA s5_read_count precursor
hsa-let-7a 3993760 hsa-let-7a-1...
16,192
Posted By jdhahbi
how to remove lines ending with '*'
I have a file where some lines end with '*'.
I would like to remove those lines ending with '*'.
inFile:
a
b*
c
d*outFile:
a
cThank you
31,872
Posted By jdhahbi
what about if add another term to my new line; ...
what about if add another term to my new line;
my new line looks like tihs:
name=test color="255,0,0 0,0,255" priority=10awk 'BEGIN{print "name=test color=\"255,0,0 0,0,255\"" priority=10}{print}'...
31,872
Posted By jdhahbi
got it. thanks ---------- Post updated...
got it. thanks

---------- Post updated 09-02-10 at 05:27 PM ---------- Previous update was 09-01-10 at 06:38 PM ----------

Hi frank_rizzo

I have a follow up question.
my new line must...
31,872
Posted By jdhahbi
awk works fine $awk 'BEGIN{print "new...
awk works fine
$awk 'BEGIN{print "new line"}{print}' infile > outfile
$cat outfile
new line
a b c
A E F
1 2 3
but the other dosen't look right

$ echo "new line" >foo
$ cat foo infile...
31,872
Posted By jdhahbi
add a new line on top of a file
infile
a b c
A E F
1 2 3 outfile
new line
a b c
A E F
1 2 3 I tried:

sed '1i\
new line' infile > outfilecat outfile
new linea b c
A E F
1 2 3 I don't want the new line be added to the...
1,517
Posted By jdhahbi
delete lines and columns from a file
how do I delete the first 3 lines and the first column and the tab?

infile:
Colorspace 0
SA-Sample 1 in 32
FTab-Chars 10
Sequence-1 SINE1_7SL 282
Sequence-2 sapieTTns 289...
3,588
Posted By jdhahbi
it is much better now; I need to replace '/' by...
it is much better now; I need to replace '/' by '_' also:

$awk '/^>/ { gsub( "[ \t]", "_", $0 ); } { print; }' infile.txt
>AluYa5_SINE1/7SL_Homo_sapiens...
3,588
Posted By jdhahbi
$ head infile.txt | od -x -c 0000000 413e ...
$ head infile.txt | od -x -c
0000000 413e 756c 6159 0935 4953 454e 2f31 5337
> A l u Y a 5 \t S I N E 1 / 7 S
0000020 094c ...
3,588
Posted By jdhahbi
Hi agama...
Hi agama (https://www.unix.com/members/302081960.html)
How do I check which type of spaces I have in my file?
Also, can I send you my infile as an attachment so you can examine it?
I think when I...
3,588
Posted By jdhahbi
it replaced only some: sed "/^>/s/[ \t/]/_/g"...
it replaced only some:
sed "/^>/s/[ \t/]/_/g" infile.txt
>AluYa5 SINE1_7SL Homo_sapiens
ggccgggcgcggtggctcacgcctgtaatcccagcactttgggaggccgaggcgggcggatcacgaggtc...
23,890
Posted By jdhahbi
Perfect. It works. Thanks ---------- Post...
Perfect. It works. Thanks

---------- Post updated at 02:35 PM ---------- Previous update was at 02:32 PM ----------




this code also works. Thanks
3,588
Posted By jdhahbi
how to replace spaces with '_' in a file?
Hello

#I have a file with a list of sequences; the sequence name is the line starting with '>'.
$cat infile

>AluYa5 SINE1/7SL Homo sapiens...
23,890
Posted By jdhahbi
Hi radoulov...
Hi radoulov (https://www.unix.com/members/302021308.html)
##
$ls
file1 file2 file3 file4
##
$printf '%s\n' *|paste -sd,>list
usage: paste [-s] [-d delimiters] file ...
##
$ ls
file1 ...
Showing results 1 to 25 of 71

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