Hi all,

I have 7 words


Code:

CAD
CD
HT
RA
T1D
T2D
BD
Now I have 1 file which contain data in large number of rows and columns

from 2 nd column onwards it contain any of these 7 words or may be more than one words among above 7 words:


these 7 names are present in starting from 2nd column

means the file contain any of these 7 words in coulmns 2,3,4,5,6,7,89,10...

It's a big file in terms of columns not rows.

our input is


Code:

CYP1B1 (PA27094) paclitaxel (PA450761) RA (PA27094) docetaxel (PA449383) RA (PA27094) RA (PA27094) capecitabine (PA448771);cisplatin (PA449014);docetaxel (PA449383);epirubicin (PA449476);gemcitabine (PA449748) RA (PA27094) capecitabine (PA448771);cisplatin (PA449014);docetaxel (PA449383);epirubicin (PA449476);gemcitabine (PA449748) RA
HLA-DRA (PA35071) T1D,T1D,T1D,T1D,T1D,T1D,T1D,T1D,T1D,T1D,T1D,RA,RA,RA,RA,RA,RA,RA,RA,RA,RA,RA,RA,RA
ESR1 (PA156) T2D,BD (PA156) conjugated estrogens (PA164754789);medroxyprogesterone (PA450344) T2D,BD (PA156) Alkylating Agents (PA164712331);cisplatin (PA449014) T2D,BD (PA156) tamoxifen (PA451581) T2D,BD
HTR1A (PA192) paroxetine (PA450801);sertraline (PA451333) CAD,CD (PA192) antidepressants (PA452229) CAD,CD (PA192) antidepressants (PA452229) CAD,CD
HTR1B (PA29549) paroxetine (PA450801) CD (PA29549) clomipramine (PA449048);liothyronine (PA164778866);Lithium (PA164712869);nefazodone (PA450603);venlafaxine (PA451866) CD
CHST3 (PA26503) docetaxel (PA449383);thalidomide (PA451644) T2D,T2D (PA26503) docetaxel (PA449383);thalidomide (PA451644) T2D,T2D (PA26503) docetaxel (PA449383);thalidomide (PA451644) T2D,T2D
HTR6 (PA29560) atorvastatin (PA448500);pravastatin (PA451089);simvastatin (PA451363) T1D
HTR7 (PA29561) atorvastatin (PA448500);pravastatin (PA451089);simvastatin (PA451363) HT,HT (PA29561) atorvastatin (PA448500);pravastatin (PA451089);simvastatin (PA451363) HT,HT (PA29561) atorvastatin (PA448500);pravastatin (PA451089);simvastatin (PA451363) HT,HT
ALDH3A1 (PA24697) carboplatin (PA448803);cyclophosphamide (PA449165);thiotepa (PA451668) BD,BD
ALDH3A2 (PA24698),SLC47A2 (PA162403847) BD,BD
DRD1 (PA147) bupropion (PA448687);nicotine (PA450626) HT,HT,HT,HT (PA147) HT,HT,HT,HT (PA147) HT,HT,HT,HT (PA147) drotrecogin alfa (PA131548935) HT,HT,HT,HT
NCF4 (PA31465) doxorubicin (PA449412) RA

I want the output shuld be 7 files with separate data for HT, T1D,T2D onwards

For eg RA file will surely contain in output


Code:

CYP1B1 (PA27094) paclitaxel (PA450761) (PA27094) docetaxel (PA449383) capecitabine (PA448771);cisplatin (PA449014);docetaxel (PA449383);epirubicin (PA449476);gemcitabine (PA449748) capecitabine (PA448771);cisplatin (PA449014);docetaxel (PA449383);epirubicin (PA449476);gemcitabine (PA449748)

and other more entires in the same way for other 6 output files.