Jacob S. wrote:
I assume that both you and Liam are using previous-er versions of python?
Now files are iterators by line and you can do this.
openFile = open("probe_pairs.txt","r")
indexesToRemove = []
for line in openFile:
# [...]
My version of Python isn't *that* old (IIRC this works since 2
I'm using 2.3, I was trying to be as explicit as possible. *grin*
On Thu, 13 Jan 2005 22:02:13 -0500, Jacob S. <[EMAIL PROTECTED]> wrote:
> I assume that both you and Liam are using previous-er versions of python?
> Now files are iterators by line and you can do this.
>
> openFile = open("probe_
I assume that both you and Liam are using previous-er versions of python?
Now files are iterators by line and you can do this.
openFile = open("probe_pairs.txt","r")
indexesToRemove = []
for line in openFile:
if line.startswith("Name="):
line = '' ## Ooops, this won't work because it
> I have looked into many books including my favs(
> Larning python and Alan Gaulds Learn to program using
Yes this is pushing regex a bit further than I show in my book.
> What I want to extract:
> I want to extract 164:623:
> Which always comes after _at: and ends with ;
You should be able to
> My list looks like this: List name = probe_pairs
> Name=AFFX-BioB-5_at
> Cell1=96 369 N control AFFX-BioB-5_at
> Cell2=96 370 N control AFFX-BioB-5_at
> Cell3=441 3 N control AFFX-BioB-5_at
> Cell4=441 4 N control AFFX-BioB-5_at
> ...
> My Script:
> >>> name1 = '[N][a][m][e][=]'
Why not just: 'N
On 13 Jan 2005, [EMAIL PROTECTED] wrote:
> My list looks like this: List name = probe_pairs
> Name=AFFX-BioB-5_at
> Cell1=96 369 N control AFFX-BioB-5_at
> Cell2=96 370 N control AFFX-BioB-5_at
> Cell3=441 3 N control AFFX-BioB-5_at
> Cell4=441 4
Quoting kumar s <[EMAIL PROTECTED]>:
> For example:
>
> I have a simple list like the following:
>
> >>> seq
> ['>probe:HG-U133B:20_s_at:164:623;
> Interrogation_Position=6649 ; Antisense;',
> 'TCATGGCTGACAACCCATCTTGGGA']
>
>
> Now I intend to extract particular pattern and write
> to anot
Hello group:
thank you for the suggestions. It worked for me using
if not line.startswith('Name='): expression.
I have been practising regular expression problems. I
tumle over one simple thing always. After obtaining
either a search object or a match object, I am unable
to apply certain metho
> Quoting Jeff Shannon <[EMAIL PROTECTED]>:
[ snip ]
> (hmm, I wonder which is the faster option...)
Propably "grep -v ^Name= filename"
> --
> John.
0.2 EUR, J"o!
--
Wir sind jetzt ein Imperium und wir schaffen uns
unsere eigene Realität. Wir sind die Akteure der
Geschichte, und Ihnen, I
Quoting Jeff Shannon <[EMAIL PROTECTED]>:
> If the intent is simply to remove all lines that begin with "Name=",
> and setting those lines to an empty string is just shorthand for that,
> it'd make more sense to do this with a filtering list comprehension:
[...]
> If one wants to avoid list comp
Liam Clarke wrote:
openFile=file("probe_pairs.txt","r")
probe_pairs=openFile.readlines()
openFile.close()
indexesToRemove=[]
for lineIndex in range(len(probe_pairs)):
if probe_pairs[lineIndex].startswith("Name="):
probe_pairs[lineIndex]=''
If the intent is simply to remo
...as do I.
openFile=file("probe_pairs.txt","r")
probe_pairs=openFile.readlines()
openFile.close()
indexesToRemove=[]
for lineIndex in range(len(probe_pairs)):
if probe_pairs[lineIndex].startswith("Name="):
indexesToRemove.append(lineIndex)
for index in indexesToRe
On Thu, 13 Jan 2005, kumar s wrote:
> My list looks like this: List name = probe_pairs
> Name=AFFX-BioB-5_at
> Cell1=96 369 N control AFFX-BioB-5_at
> Cell2=96 370 N control AFFX-BioB-5_at
> Cell3=441 3 N control AFFX-BioB-5_at
> Cell4=441 4
Dear group:
My list looks like this: List name = probe_pairs
Name=AFFX-BioB-5_at
Cell1=96369 N control AFFX-BioB-5_at
Cell2=96370 N control AFFX-BioB-5_at
Cell3=441 3 N control AFFX-BioB-5_at
Cell4=441 4 N control AFFX-BioB-5_
14 matches
Mail list logo