471,354 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Issue with CSV

Hello,
I'm working on a script which collects some data and puts into a csv
file which could be exported to excel.
so far so good, I'm able to do what I described.
When I run the script for the second time after a certain period of
time the results should appear next to the results of the last run,
I'm unable to make a new column when the script is run after the first
time.
Ideally I would like to have an output which looks like this.
1/20 1/27
we.py we.py
gh.py gj.py <- Indicating tht the file has changed
fg.py fg.py

Please help me out.
Thanks

Jul 19 '07 #1
1 1212
Rohan <vo********@gmail.comwrites:
Hello,
I'm working on a script which collects some data and puts into a csv
file which could be exported to excel.
so far so good, I'm able to do what I described.
When I run the script for the second time after a certain period of
time the results should appear next to the results of the last run,
I'm unable to make a new column when the script is run after the first
time.
Ideally I would like to have an output which looks like this.
1/20 1/27
we.py we.py
gh.py gj.py <- Indicating tht the file has changed
fg.py fg.py

Please help me out.
Thanks
We'd need to see code to tell what you are doing wrong. The solution is pretty obvious:

1. Model the needed structure, which is a 2D matrix of script x date.
Assuming the above output is the nromal case, this can be done with a
list of rows, each of which has a list of entries by date.

2. Write reader code which reads a csv and loads it into this structure.

3. Write writer code which writes this structure out to csv.

4. Write orchestration code to a) read the old csv, b) check the
loaded structure's data against the new data-on-disk to find changed
files, c) update the structure appropriately, d) write out the
resulting new csv.

--
Harry George
PLM Engineering Architecture
Jul 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by George Hester | last post: by
2 posts views Thread by Anthony Cuttitta Jr. | last post: by
reply views Thread by Kevin Spencer | last post: by
reply views Thread by Charles Leonard | last post: by
4 posts views Thread by Paul | last post: by
1 post views Thread by AlekseyUS | last post: by
13 posts views Thread by SAL | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.