Re: [Tutor] get columns from txt file

2012-07-12 Thread susana moreno colomer
Hi! I am trying this, but still I get 6 numbers per cell. The only one difference is that I get a comma between numbers instead an space. I am opening the document also with excel Many thanks, Susana Subject: Re: [Tutor] get columns from txt file From: dfjenni...@gmail.com Date: Thu, 12 Ju

Re: [Tutor] Accessing a Website

2012-07-12 Thread Steven D'Aprano
Fred G wrote: With the exception of step 6, I'm not quite sure how to do this in Python. Is it very complicated to write a script that logs onto a website that requires a user name and password that I have, and then repeatedly enters names and gets their associated id's that we want? Python

Re: [Tutor] get columns from txt file

2012-07-12 Thread Prasad, Ramit
> >> csv_out=csv.writer(open('out14.csv', 'wb'), dialect='excel') > > > > The default dialect is excel but it is important to also open > > the file using Excel as it may default to a text editor. > > In the context we're talking about here this makes no sense to me so can > you please explain. >

Re: [Tutor] Script to collect values from .csv

2012-07-12 Thread Dave Angel
On 07/12/2012 12:29 PM, Emma Knowles wrote: > Hi all, > > > I have a very large .csv (correlationfile, which is 16 million lines > long) which I want to split into smaller .csvs. The smaller csvs > should be created be searching for a value and printing any line > which contains that value - all th

Re: [Tutor] get columns from txt file

2012-07-12 Thread Mark Lawrence
Sorry if this shows up twice On 12/07/2012 17:18, Prasad, Ramit wrote: csv_out=csv.writer(open('out14.csv', 'wb'), dialect='excel') The default dialect is excel but it is important to also open the file using Excel as it may default to a text editor. In the context we're talking about here

Re: [Tutor] Accessing a Website

2012-07-12 Thread Prasad, Ramit
> > My pseudocode is the following > > > > new_dictionary = [] > > for name in file: > > #1) log into university account > > #2) go to website with data > > #3) type in search box: name > > #4) click search > > #5) if name is exact match with name of one of the hits: > > line.find("Code Nu

Re: [Tutor] Accessing a Website

2012-07-12 Thread Joel Goldstick
On Thu, Jul 12, 2012 at 2:03 PM, Fred G wrote: > Hi-- > > My pseudocode is the following > > new_dictionary = [] > for name in file: > #1) log into university account > #2) go to website with data > #3) type in search box: name > #4) click search > #5) if name is exact match with name of one

[Tutor] Accessing a Website

2012-07-12 Thread Fred G
Hi-- My pseudocode is the following new_dictionary = [] for name in file: #1) log into university account #2) go to website with data #3) type in search box: name #4) click search #5) if name is exact match with name of one of the hits: line.find("Code Number") #6) remove the number

Re: [Tutor] Script to collect values from .csv

2012-07-12 Thread Prasad, Ramit
> I have a very large .csv (correlationfile, which is 16 million lines long) > which I want to split into smaller .csvs. The smaller csvs should be created > be searching for a value and printing any line which contains that value - all > these values are contained in another .csv (vertexfile). I t

[Tutor] Script to collect values from .csv

2012-07-12 Thread Emma Knowles
Hi all, I have a very large .csv (correlationfile, which is 16 million lines long) which I want to split into smaller .csvs. The smaller csvs should be created be searching for a value and printing any line which contains that value - all these values are contained in another .csv (vertexfile). I

Re: [Tutor] get columns from txt file

2012-07-12 Thread Emile van Sebille
On 7/12/2012 9:06 AM susana moreno colomer said... Hi! This code is working fine! The only one little thing is that the 6 columns appear together in one column, what means, in eac cell I get 6 numbers. How can I get tit in 6 excel columns? You're creating a list (output) with only one column

Re: [Tutor] get columns from txt file

2012-07-12 Thread Prasad, Ramit
>> Hi! >> This code is working fine! >> The only one little thing is that the 6 columns appear togetherĀ in one >> column, what means, in eac cell I get 6 numbers. How can I get tit in 6 >> excel columns? > Programming is hard, so don't feel bad that I'm having to tell you again to > specify the

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
On Jul 12, 2012, at 12:06 PM, susana moreno colomer wrote: > > Hi! > This code is working fine! > The only one little thing is that the 6 columns appear together in one > column, what means, in eac cell I get 6 numbers. How can I get tit in 6 excel > columns? Programming is hard, so don't fee

Re: [Tutor] get columns from txt file

2012-07-12 Thread susana moreno colomer
Hi! This code is working fine! The only one little thing is that the 6 columns appear together in one column, what means, in eac cell I get 6 numbers. How can I get tit in 6 excel columns? Many thanks, Susana Subject: Re: [Tutor] get columns from txt file From: dfjenni...@gmail.com Date: Thu

[Tutor] extracting a column from many files

2012-07-12 Thread susana moreno colomer
Hi! I have a group of files in a directory: bb_1.txt bb_2.txt bb_3.txt bb_4.txt bb_5.txt bb_6.txt ss_1.txt I want to extract from files whose names start with bb_ column number 5 and 6. I want to extract all columns number 5 to one file, and all tcolumns number6 to another file. I was fo

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
On Jul 12, 2012, at 11:10 AM, susana moreno colomer wrote: > Hi! > It is attached on the email, called myprogram.txt and, here are the contents of that file: > #! /usr/bin/env python > > > import os > import fnmatch > import csv > > > path = '//../my_working_folder/' > csv_out=csv.writer(op

Re: [Tutor] get columns from txt file

2012-07-12 Thread susana moreno colomer
Hi! It is attached on the email, called myprogram.txt Thank you! Subject: Re: [Tutor] get columns from txt file From: dfjenni...@gmail.com Date: Thu, 12 Jul 2012 11:07:53 -0400 CC: tutor@python.org To: susana...@hotmail.com On Jul 12, 2012, at 10:55 AM, susana moreno colomer wrote: Hi!

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
On Jul 12, 2012, at 10:55 AM, susana moreno colomer wrote: > Hi! > > I have a group of files in a directory: > bb_1.txt > bb_2.txt > bb_3.txt > bb_4.txt > bb_5.txt > bb_6.txt > ss_1.txt > > I want to extract from files whose names start with bb_ column number 5 > to an excel file. I have

Re: [Tutor] get columns from txt file

2012-07-12 Thread susana moreno colomer
Hi! I have a group of files in a directory: bb_1.txt bb_2.txt bb_3.txt bb_4.txt bb_5.txt bb_6.txt ss_1.txt I want to extract from files whose names start with bb_ column number 5 to an excel file. I have 6 bb_ files, therefore I want to get 6 columns (5th column from each file) This cod

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
Oops! Still you forgot to cc: the tutor list. It's really important because if someone (like me, for instance) steers you in the wrong direction, others will jump in with corrections. On Jul 12, 2012, at 9:48 AM, susana moreno colomer wrote: > Hi! > Many thanks! You're welcome. I see that you

Re: [Tutor] get columns from txt file

2012-07-12 Thread Don Jennings
(Please use reply all so the message gets posted for all to see :>) On Jul 12, 2012, at 7:14 AM, susana moreno colomer wrote: > Hi! > Many thanks for your help. > Now I am trying this, but I get a blank excel document Not surprising as there are several errors in your code. In fact, I'm surprise

Re: [Tutor] advice on global variables

2012-07-12 Thread Walter Prins
Hi Chris, James has already given a response but I can't resist also chiming in, see below: On 11 July 2012 15:30, Chris Hare wrote: > I like where this is going Walter. I guess where I am confused is this: > > the globals are not static - they are set once and then won't change during > the l

Re: [Tutor] Define Build Deployment

2012-07-12 Thread Alan Gauld
On 11/07/12 16:31, James Bell wrote: I'm fairly new to software development in an enterprise environment I'm constantly hearing the term "build deployment" and do no want to ask what it means since it seems simple. I cannot find a definition online. A build deployment is the deployment of a bui

Re: [Tutor] Extracting the list from a string

2012-07-12 Thread Alan Gauld
On 11/07/12 09:48, kala Vinay wrote: say i have a string s="['a','b']" and i want to get a list object from this string s ie l=['a','b'] It depends on how complex your string is and how much you want to put in the list. If you just want to convert the entire expression into a Python