<p>I dont know much about integrating awk and ipython but if u dont have luck why not just use python to manipulate the files?</p>
<div class="gmail_quote">On Oct 13, 2012 6:34 PM, "Peng Cui" <<a href="mailto:pengcui1989@gmail.com">pengcui1989@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, I'm confused about the usage of 'awk' in ipython.<br><br><pre><code><span>For example: I want to create 3 files('chr1','chr2','chr3'). And I input the following commands:<br>
a=['chr1','chr2','chr3']<br>for eachitem in a:<br> !awk '{print $1}' '/home/ckivip/Epigenetics/Data/H1hesc/Dnamethy.bed' > '/home/ckivip/Epigenetics/Data/H1hesc/Dnamethy/$$eachitem'<br>
<br>However, I only get files named '16484eachitem','16486eachitem','16488eachitem'!! What do those mean?<br>And my question is how can I convert variables to shell from python in this situation. it can't recognize <br>
the variable '$$eachitem'. So how can I deal with it?<br><br><br></span></code></pre><br>-- <br>Peng Cui<br><font face="Verdana"><font face="Verdana"><span>Department of Bioinformatics & Biostatistics, Shanghai Jiao Tong University</span></font></font><br>
<font face="Verdana"><font face="Verdana"><span>800 Dongchuan
Road<span>,</span>Shanghai 200240<span>,</span>China</span></font></font><br><br>
<br>_______________________________________________<br>
IPython-User mailing list<br>
<a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
<br></blockquote></div>