remove brackets and put it in a column and remove repeated entry


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remove brackets and put it in a column and remove repeated entry
# 1  
Old 08-08-2012
remove brackets and put it in a column and remove repeated entry

Hi all,


I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated

Code:
ESR1 (PA156) leflunomide (PA450192)  (PA156) leflunomide (PA450192) 
CHST3 (PA26503) docetaxel (PA449383);thalidomide (PA451644)  (PA26503) docetaxel (PA449383);thalidomide (PA451644)  (PA26503) docetaxel (PA449383);thalidomide (PA451644)  (PA26503) docetaxel (PA449383);thalidomide (PA451644)  (PA26503) docetaxel (PA449383);thalidomide (PA451644)  (PA26503) docetaxel (PA449383);thalidomide (PA451644)  (PA26503) docetaxel (PA449383);thalidomide (PA451644) 
LPL (PA232) fenofibrate (PA449594) 
GALNT14 (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526)  (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526)  (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526)  (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526)  (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526)  (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526)  (PA134920089) cisplatin (PA449014);fluorouracil (PA128406956);mitoxantrone (PA450526) 
CTLA4 (PA27006) glatiramer acetate (PA449760





I want output for first row and other rows shuld be like this format

Code:
ESR1  PA156  leflunomide  PA450192  leflunomide PA450192


Last edited by manigrover; 08-08-2012 at 10:24 AM.. Reason: code tags
# 2  
Old 08-08-2012
By default the delimiter is a space so you don't have to do any code.
# 3  
Old 08-08-2012
Hi

thanks

actually I edited the out put now.

I need this output compare to above mentioned input of first row

Code:
ESR1  PA156  leflunomide  PA450192  leflunomide PA450192

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove repeated letter words

Hi, I have this text file with these words and I need help with removing words with repeated letter from these lines. 1 ama 5 bib 29 bob 2 bub 5 civic 2 dad 10 deed 1 denned 335 did 1 eeee 1 eeeee 2 eke 8... (4 Replies)
Discussion started by: crepe6
4 Replies

2. Shell Programming and Scripting

Remove multiline text between brackets

I have some text in a file like so This is {the first day of} my life. What I would like as output is This is my life. Any text between the curly braces is removed. In the forums I've found statements like sed 's/<*>//g' but the problem is that I think that... (12 Replies)
Discussion started by: climatron
12 Replies

3. Shell Programming and Scripting

Remove everything inside of brackets

I need to use something bash related to remove everything inside of brackets. For example. In the following: abc<def>ghi<jkl>mno the result should be: abcghimno (4 Replies)
Discussion started by: locoroco
4 Replies

4. Shell Programming and Scripting

Remove regularly repeated lines

How can i delete some regular repeated lines in a file? example: in_file EDGE 1 2 12 EDGE 2 3 23 EDGE 3 4 34 EDGE 5 6 56 EDGE 6 7 67 EDGE 7 8 78 EDGE 9 10 910 EDGE 10 11 1011 EDGE 11 12 1112 EDGE 13 14 1314 EDGE 14 15 1415 EDGE 15 16 1516 EDGE 17 18 1718 EDGE 18 19 1819 EDGE 19... (8 Replies)
Discussion started by: saeed.soltani
8 Replies

5. Shell Programming and Scripting

Remove whatever is mention in brackets

Hi all My previous question was complicated let me simplify it I have to just remove whatever is present in bracket () along with brackets ERCC1 (PA155) Platinum compounds (PA164713176) Allele A is not associated with response to Platinum compounds in women with Ovarian Neoplasms as... (2 Replies)
Discussion started by: Priyanka Chopra
2 Replies

6. Shell Programming and Scripting

Remove brackets repeats and separate in columns

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (4 Replies)
Discussion started by: manigrover
4 Replies

7. Shell Programming and Scripting

Finding most repeated entry in a column and giving the count

Please can you help in providing the most repeated entry in the 2nd column and give its count Here is an input file 1, This , is a forum 2, This , is a forum 1, There , is a forum 2, This , is not right Here the most repeated entry is "This" and count is 3 So output... (4 Replies)
Discussion started by: necro98
4 Replies

8. Shell Programming and Scripting

Remove brackets { } in the data

Hello folks, I have a data file in which each line has 54 numbers, and every 3 numbers are bracketed. So totally 18 pairs of brackets in each line. A typical line is like: {29.187000274658203 -16.148000717163086 -0.9380000233650208} {30.63800048828125 -15.977999687194824... (5 Replies)
Discussion started by: rockytodd
5 Replies

9. Shell Programming and Scripting

Remove text between brackets

How can I use bash to remove all text between "<" and ">" in a file? (1 Reply)
Discussion started by: locoroco
1 Replies

10. Shell Programming and Scripting

Remove repeated line using Perl

I am new to Perl and in text file of around 1000 lines having around 500 repeated line which I felt is no use and want to remove these line.so can somebody help in same for providing sample code how can i remove these repeated line in a file. (11 Replies)
Discussion started by: dinesh.4126
11 Replies
Login or Register to Ask a Question