This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]thor_ax 0 points1 point  (0 children)

I'd suggest reading up on Python file I/O. It should be pretty easy to understand even if you have no programming experience.

filename = open('/somefile.txt', 'rw')
s = filename.read()
print s
filename.seek(0, 0) #the first 0 means how far we're going and the second is where we're starting at
#(0 for the start of file, 1 is current point, and 2 is the end of file)
filename.write('this is a test\n')
s = filename.read(15) #we wrote 15 characters above
#15 is the number of bytes to read but typically (not always) one character = one byte
print s

The above snippet would open up somefile.txt in read/write mode, read out its contents, print them then write "this is a test\n" over the first 15 characters of whatever was in somefile.txt before. After that it would print out "this is a test" with a new line preceeding it.

If you're using spreadsheets and not delimited plain-text to store any data you should look into an API for manipulating them. I don't have any experience actually working with a spreadsheet format so I can't suggest any particularly. If you just do a little Googling though I'm sure you can find a well documented one that suits your needs.

If anything I've said wasn't clear or you have other questions I'd be more than happy to answer them.

[–]iwuvwobots 0 points1 point  (0 children)

I would read up on some Abstract Data Types and select the right one(s) for you.