filter unique alphabets


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting filter unique alphabets
# 1  
Old 08-10-2010
filter unique alphabets

Filter unique alphabets (bold) from input

Thanx

Code:
+SRR015270.1 HWI-B10_3_6069:2:1:653:875 length=32
SZZZZZZZZZZZZXZZZXZZZOECZZIZHUEM
+SRR015270.2 HWI-B10_3_6069:2:1:455:450 length=32
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZTT
@SRR015270.3 HWI-B10_3_6069:2:1:453:499 length=32
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZTT
@SRR015270.4 HWI-B10_3_6069:2:1:453:499 length=32
ZZZ
@SRR015270.5 HWI-B10_3_6069:2:1:453:499 length=32
ZZZ

output

Code:
+SRR015270.1 HWI-B10_3_6069:2:1:653:875 length=32
SZZZZZZZZZZZZXZZZXZZZOECZZIZHUEM
+SRR015270.2 HWI-B10_3_6069:2:1:455:450 length=32
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZTT
@SRR015270.4 HWI-B10_3_6069:2:1:453:499 length=32
ZZZ

# 2  
Old 08-10-2010
Code:
awk '{x=$0;getline;if (a[$0]==0){print x"\n"$0;a[$0]++}}' file

# 3  
Old 08-10-2010
Another one:
Code:
awk 'NR%2{p=$0;next}!($0 in a){print p RS $0;a[$0]}' file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

CSV File:Filter duplicate records from column1 & another column having unique record

Hi Experts, I have csv file with 30, 40 columns Pasting just 2 column for problem description. Need to print error if below combination is not present in file check for column-1 (DocumentNumber) and filter columns where value in DocumentNumber field is same. For all such rows, the field... (7 Replies)
Discussion started by: as7951
7 Replies

2. Shell Programming and Scripting

awk to filter out lines containing unique values in a specified column

Hi, I have multiple files that each contain four columns of strings: File1: Code: 123 abc gfh 273 456 ddff jfh 837 789 ghi u4u 395 File2: Code: 123 abc dd fu 456 def 457 nd 891 384 djh 783 I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
Discussion started by: owwow14
3 Replies

3. UNIX for Dummies Questions & Answers

Replace alphabets from certain positions

Hi all, I have column 2 full of values like HIVE4A-56 and HIVE4-56. I want to convert all values like HIVE4A-56 to HIVE4-56. So basically I want to delete all single alphabets before the '-' which is always preceded by a number. Values already in the desired format should remain unchanged... (4 Replies)
Discussion started by: ames1983
4 Replies

4. Shell Programming and Scripting

Change unique file names into new unique filenames

I have 84 files with the following names splitseqs.1, spliseqs.2 etc. and I want to change the .number to a unique filename. E.g. change splitseqs.1 into splitseqs.7114_1#24 and change spliseqs.2 into splitseqs.7067_2#4 So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies

5. UNIX for Dummies Questions & Answers

perl filter unique and concatenate

Hi experts, I have some input like below, TEST A function W TEST A function X TEST B function Y TEST C function Z TEST C function ZY i would like to have below output, TEST A function W&X TEST B function Y TEST C function Z&ZY Please kindly help on this, i am cracking my head... (2 Replies)
Discussion started by: mingfatty
2 Replies

6. Shell Programming and Scripting

Filter certain number of alphabets

filter the ones (ex:>1279_17_27_F3) that have 50letters (ABABABACACACACACAADADADADABABABABAACACACACACACAACAC) in input. And others that are less than 50 have to be ignore and the ones with more than 50 have to trimmed to first 50 letters. Thanx >1279_16_1960_F3 A >1279_16_2010_F3 BCCC... (2 Replies)
Discussion started by: ruby_sgp
2 Replies

7. Shell Programming and Scripting

Checking for Alphabets

echo -n "read this also:" read NewAuthor if ]' ) ] ; then echo "its a digit" else echo "something else" fi Hey guys , i am trying to do a search to check if the input is using alphabets and nothing else. I tried using ] and ] but none seems to work When i use digit, it read 22.k... (5 Replies)
Discussion started by: gregarion
5 Replies

8. Shell Programming and Scripting

get part of file with unique & non-unique string

I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM". I can find the line number for the beginning of the statement section with sed. ... (5 Replies)
Discussion started by: andrewsc
5 Replies

9. Shell Programming and Scripting

Omitting the last 2 alphabets in the words

Hi Guys, Bit new to Unix shell scripting so this question might seems little kiddish for you. what im trying to achieve here is : I have file which is compressed like Account_52320090605076_log.Z so in my shell script i call this file also as one of my parameters like ... (4 Replies)
Discussion started by: coolrekz
4 Replies

10. UNIX for Advanced & Expert Users

Extracting only Alphabets from a value

Hi, I have file name (abcd001). I want to extract on the alphabets from this file name. I don't want the numeric part of it. Once i extract the alphabets the i can search for all those file. Could anyone help on this. Thanks in advance (2 Replies)
Discussion started by: amitkhiare
2 Replies
Login or Register to Ask a Question