Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-26-2008, 09:51 PM
Natedawg1848 Natedawg1848 is offline
Newbie
 
Join Date: Mar 2008
Posts: 2
Rep Power: 0
Natedawg1848 is on a distinguished road
Default Need help streamlining averaging values from separate csv spreadsheets

I'm analyzing data that I am extracting from simulations at periodic time steps and my data can only be extracted in the form of individual spreadsheets. Each spreadsheet has something like 83,000 rows and 7 columns of values. I have 12 different cases, each with about 100-150 spreadsheets. It would be a waste of time to do it manually.

So for one case I have a directory with text spreadsheets in them. There are 7 columns of data in each spreadsheet, all with tab delimiters.

I want to average the values across all of the files. What i mean is I want the first value of the first column in all 100 files to be averaged together and so on

Shouldn't be terribly hard.

Open file
store all data to matrix
count=count+1
close file
open next file
add to existing matrix
count=count+1
close file

rinse and repeat until all files have been added.
At the end, divide everything by count.

the files are csv files but may be treated as txt files.

they are named as follows:
table5
table10
table15
table20
.....
...
..
.

Any help would be greatly appreciated on this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-27-2008, 11:21 PM
Natedawg1848 Natedawg1848 is offline
Newbie
 
Join Date: Mar 2008
Posts: 2
Rep Power: 0
Natedawg1848 is on a distinguished road
Default Re: Need help streamlining averaging values from separate csv spreadsheets

Nevermind, figured it out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sudoku can be solved using SQL..Take a look! roger Database & Database Programming 5 07-04-2006 03:20 PM


All times are GMT -5. The time now is 11:47 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads