Re: To remove some lines from a file

2006-10-25 Thread umut . tabak
Thanks, I have learnt sth from the library BTW. Regards On Oct 25, 3:32 pm, "Jerry" <[EMAIL PROTECTED]> wrote: > Very inelegant, but you get the idea: > > counter = 0 > > f = open("test.txt") > for line in f.readlines(): > if line[0] != "$" and counter < 2: > counter += 1 > co

To remove some lines from a file

2006-10-25 Thread umut . tabak
Dear all, I am quite new to python. I would like to remove two lines from a file. The file starts with some comments, the comment sign is $. The file structure is $ $ $ $ $ $ $ . . . . $ line1 line 2 $ $ . . . $ actual commands I would like to delete those two lines at the very beginning of the

Re: Script to count files in a folder

2006-10-23 Thread umut . tabak
On Oct 23, 3:11 pm, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > A batch file creates this file and deletes that file in the same loop. > > This file is intended to start the reading of an input file. After it > > is read batch file deletes this file automatically and

Script to count files in a folder

2006-10-23 Thread umut . tabak
Dear all, We have a multi-platform application(Windows-Linux). Linux part of our application is writing some input and trigger files on the a shared drive. What I want to do is to be able to count the occurence of these trigger files. lets say my file is file.start A batch file creates this fil