Averaging accepted force records

An instrument exports a UTF-8 text file with the following physical lines. An entry labelled blank represents an empty line; all other entries show the literal line contents without their newline characters.


Physical line

Contents

1

time_s,force_N

2

0.0,18.6

3

0.5,19.8

4

1.0,NA

5

blank

6

1.5,21.0

7

2.0,20.2


The processing specification says to skip the header, ignore blank lines, and exclude records whose force field is exactly NA. All remaining force fields are converted to numbers. Calculate the arithmetic mean of the accepted force measurements. Answer in N, to one decimal place.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Text File Operations Questions: