[IPython-User] 'awk' in ipython?

Adam Hughes hughesadam87@gmail....
Sat Oct 13 18:19:29 CDT 2012


I dont know much about integrating awk and ipython but if u dont have luck
why not just use python to manipulate the files?
On Oct 13, 2012 6:34 PM, "Peng Cui" <pengcui1989@gmail.com> wrote:

> Hi, I'm confused about the usage of 'awk' in ipython.
>
> For example: I want to create 3 files('chr1','chr2','chr3'). And I input the following commands:
>
> a=['chr1','chr2','chr3']
> for eachitem in a:
>     !awk '{print $1}' '/home/ckivip/Epigenetics/Data/H1hesc/Dnamethy.bed' > '/home/ckivip/Epigenetics/Data/H1hesc/Dnamethy/$$eachitem'
>
> However, I only get files named '16484eachitem','16486eachitem','16488eachitem'!! What do those mean?
> And my question is how can I convert variables to shell from python in this situation. it can't recognize
>
> the variable '$$eachitem'. So how can I deal with it?
>
>
>
> --
> Peng Cui
> Department of Bioinformatics & Biostatistics, Shanghai Jiao Tong University
> 800 Dongchuan Road,Shanghai 200240,China
>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121013/dafca02b/attachment.html 


More information about the IPython-User mailing list