#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    63
    Rep Power
    2

    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


    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    776
    Rep Power
    495
    Try this:

    Perl Code:
    while (<FILE_IN>) {
         tr/()//d;
         # ...
    }

IMN logo majestic logo threadwatch logo seochat tools logo