Thanks a lot for your help, it has taught me a lot! By the way, I am also a geophysicist, with just over a year of experience.
I have got the script doing what I want, using your method to create a list. I didn't need to know each file, just the frequency per day so I just made a list of the...
Hello,
I am trying to count the number of files created per day with a given extension. I am searching a folder recursively.
What I have at the moment counts the number of files per day, but does not include those days where there are no files.
#!/usr/bin/env python
import os, glob, time...
Thanks a million Mikrom - this is a much nicer way of doing , and I could adapt this easily for lots of other files I export...
I've added a header with the date and time to the output file, and have asked user for input and output files, as well as what string to put at the start of each line...
Sorry for not realising I could actually do it... added
outp.write('\n' + sipstr + " ")
and outp.write(aTuple[0] + " " + aTuple[1] + " ") after the two print commands and it works great.
Now making it not add a new line at the start...
Well, I solved my loop problem, and I can now get it to display exactly the format I want on screen:
uinp = raw_input('input file? ')
inp = open(uinp,"r")
uout = raw_input('output file? ')
outp = open(uout,"a")
sipstr = raw_input('SIPMAP string? ')
# Set counter to 0
i = 0
# iterate...
The problem:
I want to enter a text file, in the format below:
3974.1399 1693.0822 1921.5103 1 3 3 event_outline
3877.0623 1658.3441 1854.6477 2 3 3 event_outline
3818.4111 1641.9969 1769.8671 2 3 3 event_outline
2461.6321 1632.2740...
Hi,
Sorry for the long post, but I thought as much info as possible would help...
I did 8 weeks of fortran77 at university last year, and was always terrible. But I have been trying to use it recently at work to automate a task, trying to format the contents of an ascii text file. I am doing it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.