Search Results

Search: Posts Made By: Digby
5,096
Posted By Digby
Sort and uniq lines of a file while keeping a header line
So, I have a file that has some duplicate lines. The file has a header line that I would like to keep at the top.

I could do this by extracting the header from the file, 'sort -u' the remaining...
2,695
Posted By Digby
Thanks, I knew there would be something like...
Thanks, I knew there would be something like this... never looked into it.
2,695
Posted By Digby
awk -F\/ '{print $7}' < $yourFile >...
awk -F\/ '{print $7}' < $yourFile > $youNewFile
25,623
Posted By Digby
What kind of script is it? It's probably not that...
What kind of script is it? It's probably not that same as the shell you are working from.

Your command wouldn't work in my console. But it did when I changed it to this.

set a = `ps aux | awk...
3,266
Posted By Digby
There is probably a much much easier way to do...
There is probably a much much easier way to do this, but here's how I would do it given my limited knowledge.

perl -pe 's/SEQ/SEQSEQ/' < $yourfile |\
perl -pe 's/\w\w\w//' | perl -pe...
13,934
Posted By Digby
All of the following work for me. I think some of...
All of the following work for me. I think some of them have been suggested before.

perl -pe 's/\|//' < file

sed 's/|//g' < file

awk -F\| '{print $1}' < file
25,622
Posted By Digby
Ha, I just tried seaching again, but I used the...
Ha, I just tried seaching again, but I used the title of this post as the search term in google and found it. :o

It's "paste"

I'd tried various combination "lateral join files" etc before.
25,622
Posted By Digby
combine files line by line
Hi all,

I once knew of a simple unix command to do this, but I can't remember it and I can't find it by searching.

I have two files.

### FILE A ####
A1
A2
A3
A4
A5

### FILE B ####...
7,016
Posted By Digby
Sorry dude, I just reread your post and realised...
Sorry dude, I just reread your post and realised what output you're looking for.
You want the the final output to be from file A. :o

Could you convert it to a single line format and then use...
3,380
Posted By Digby
Thanks for the input guys. You've given me a bit...
Thanks for the input guys. You've given me a bit to work with.
I've decided to accept this is what sort does and have added space characters after the identifier in the list file to get the same...
3,380
Posted By Digby
Thanks, but I've already tried it. I get the same...
Thanks, but I've already tried it. I get the same output as above.
7,016
Posted By Digby
I realize that's what you want to do, but with...
I realize that's what you want to do, but with these large files grepping every query against every line isn't feasible (at least for my files). Even with a modest number of queries it is painfully...
7,016
Posted By Digby
you don't need to touch file B Here's how...
you don't need to touch file B

Here's how I'd do it... I think it should be very quick.

osscl1head01 1447>cat fileA
// 223 missing
223,Jan,ee,bla,bla

// data not found...
7,016
Posted By Digby
can you extract the required identifiers into a...
can you extract the required identifiers into a different file with awk and/or grep?
3,380
Posted By Digby
Thanks, but I'm still getting the same result......
Thanks, but I'm still getting the same result... wierd!

daisy 1807>cat head.fps | awk '{print $1,$2,"..."}' | sort -d
101m_lig1_frag10 124 ...
101m_lig1_frag11 124 ...
101m_lig1_frag1 124 ......
7,016
Posted By Digby
By chance, I came on here with exactly the same...
By chance, I came on here with exactly the same problem.

I think that join may come in useful here:
> join -1 1 -2 5 -t, $fileA $fileB > $requiredFile

The thing is the files need to be sorted...
3,380
Posted By Digby
What's going wrong with sort?
Sort isn't behaving as I expect. Can someone tell me what's going on?
Incidentally, the infile was ordered by 'sort' previously.
Why is 101m_lig1_frag1 before 101m_lig1_frag12 but after ...
6,816
Posted By Digby
Thanks for the help guys - the python worked a...
Thanks for the help guys - the python worked a treat Shawn. :)
6,816
Posted By Digby
sorting fields of a line
Hi all,

I have a file that looks like this...

##########
1zz2_15-43 1ouy_0-13-35 1.12619901947
2gfs_41-7 1yqj_3 0.793602121208
1bl7_11-3 1wbo_1-3-4 0.791065168287
1ywr_16-3 2ghl_22...
42,309
Posted By Digby
Thanks for the quick response radoulov. It...
Thanks for the quick response radoulov.
It works a treat! :D
42,309
Posted By Digby
Uniq using only the first field
Hi all,

I have a file that contains a list of codes (shown below).
I want to 'uniq' the file using only the first field. Anyone know an easy way of doing it?

Cheers,

Dave

##### Input...
Showing results 1 to 21 of 21

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