I have two file one ise set of gene it look like file (a) cv

Microsoft Excel 010 - complete package
August 13, 2012 at 21:28:33
Specs: Windows 7, 6GB
I have two file
one ise set of gene it look like file (a)
cvpA katG
cvpA katE
recA katE

:
:
etc

the another file (b) one will look like
aat
katE
ppfA
cvpA
:
:
etc
My aim is
take all the gene pair from file(a)
so the condition atleast one gene belongs to file(b) gene
So My Out put will look like

cvpA katG --------cvpA
cvpA katE --------cvpA,katE
recA katE --------katE
:
:
:


See More: I have two file one ise set of gene it look like file (a) cv

Report •

#1
August 14, 2012 at 19:17:04
is the data "case-sensitive"? (f/e: kate is equal katE means no, kate not equal katE means YES, it IS case sensitive.) And I'm referring, of course, only to batch, not gene-splicers or cloning ovens. ;-)

Report •

#2
August 14, 2012 at 20:27:24
Yes .....It is case sensitive..On thing is tht ... Number of rows will be same in
File (A) and expecting "result file"

Report •

#3
August 14, 2012 at 21:39:55
Well, I'm gonna try this anyway. my fault if it bombs.

@echo off & setlocal enabledelayedexpansion
for /f %%a in (fileb) do set %%a=1
for /f "tokens=1,2" %%a in (filea) do (
set out=%%a %%b-----------
if defined %%a set out=!out!%%a
if defined %%b (
if defined %%a (set out=!out!, %%b) else (set out=!out!%%b)
)
echo.!out!
)
pause


Report •

Related Solutions

#4
August 15, 2012 at 06:35:36
Thanks 4 the replay
Its perl or which prompt i will do ?

Report •

#5
August 15, 2012 at 12:41:12
looks like a .bat file, and then run it from there.


edit: I shouldn't assume

if you open a notepad and paste the text into the document and then click on save as, and then type a prefered name etc excel.bat. then select save as all files. then double click
:: mike


Report •

#6
August 15, 2012 at 18:01:03
yes, I didn't see the "python" tag till after I posted. It's a batchscript. just make the filenames correct for your environment, save it as extension .bat, and run it. Hopefully it will do the job, and you can use it, even though it's not perl or python (neither of which I am familiar with.)

Report •

#7
August 15, 2012 at 21:49:08
i have done according "mikelinus "
Just copy paste the commands such as

" @echo off & setlocal enabledelayedexpansion
for /f %%a in (fileb) do set %%a=1
for /f "tokens=1,2" %%a in (filea) do (
set out=%%a %%b-----------
if defined %%a set out=!out!%%a
if defined %%b (
if defined %%a (set out=!out!, %%b) else (set out=!out!%%b)
echo.!out!
)
)
"
i have saved the file as "demo.bat" and double click ... But one black window open and close... i didn't get the result!!


Report •

#8
August 16, 2012 at 18:16:04
sorry, this is my bad. add one last line at very end of script: pause
this will keep the "black window" (command) open long enough to see what the result was.
also saw another mistake I made and corrected (in main script post). If you want me to refresh the code, I'll PM it to you. These are my failings. Let me know...

Report •

#9
August 18, 2012 at 11:13:26
yes please

Report •

#10
August 18, 2012 at 11:13:56
can I get you mail ID?

Report •

#11
August 20, 2012 at 22:24:24
can I get you mail ID?

Report •

Ask Question