Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+32 votes

Can anyone give us head start with exporting our manual tracking data? We're having trouble

asked in CSC285_Fall2018 by (1 point)

1 Answer

+18 votes

If you have your data stored inside AnimalTrack objects, then it should be fairly simple to loop through all the TimePoints inside an AnimalTrack object, printing out something like:

chickID1,time1,x1,y1
chickID1,time2,x2,y2
...
chickID2,time1,x1,y1
chickID2,time2,x2,y2
...

You could print it out to the console first, and once that's working, switch it over to print to a PrintWriter attached to a FileWriter. To make a CSV file (comma-separated-value) file that you can open in Excel, you can simply create a text file that has numbers in it separated by commas. (You learned how to print things to text files back in CSC 211... Chapter 6, if you still have your textbook...)

answered by (508 points)
...