Computing.Net > Forums > Programming > Select data from csv, into new file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Select data from csv, into new file

Reply to Message Icon

Name: acantha
Date: August 23, 2007 at 10:51:30 Pacific
OS: n/a
CPU/Ram: n/a
Product: n/a
Comment:

I've got a series of tests i'm trying to automate, and the last step is to take the CSV results file from each individual test, select specific pieces of information, and compile the results into a new CSV.
This is what the CSV looks like:

batterytest.txt,,,,,
, 0.000, event, State,Preview,
, 0.516, , , ,//
, 0.517, , , ,// BatteryTest script
, 0.517, , , ,//
, 0.517, , , ,// This will start a record and read the battery every 60 seconds.
, 0.518, , , ,// It will delete the clip so that this will run till the batteries run out
, 0.518, , , ,//
, 0.519, lcd,battery_test, ,
, 0.533, wait, 2, ,
, 2.933,lcdread, battery,235,
.
.
.
,9927.277, event,BatteryStatus,1/3Full,

i need the script to look at a directory of csv files, and for each one do the following: log the file name, log the numeric value following the first and last incidence of lcdread, find and log the very last time stamp, then find the first BatteryStatus event and log its time stamp.

it feels a bit complicated, but i don't think i'm being overly ambitious. I think theres a lot of options for how i can go about approaching this. I'm not well versed in programming, but i pick things up quick, so whatever you think is a good solution, i'd be grateful for. I'd prefer something installation light, but i'm not married to the idea. Thanks in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: August 23, 2007 at 14:12:49 Pacific
Reply:

so what have you tried?


0

Response Number 2
Name: acantha
Date: August 24, 2007 at 11:19:23 Pacific
Reply:

my programming experience is limited, but i get by with excel macros in some places, so i've been poking around there with little success. i tried some bat scripts, but i don't think that i'm going to be able to do the searching i want there. I think i could do it in perl and/or awk, as i did something very similar a few years ago for another company. been a while since i played with either perl or awk tho.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Select data from csv, into new file

Extracting String data from a line www.computing.net/answers/programming/extracting-string-data-from-a-line/17367.html

Process a downloaded CSV file ? www.computing.net/answers/programming/process-a-downloaded-csv-file-/17452.html

Reading data from a file by using batch file www.computing.net/answers/programming/reading-data-from-a-file-by-using-batch-file/19995.html