Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interpolation

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a file with the following format:


dist1 dist2 dist3 dist4 ...
--------------------------------------
stress1 stress2 stress3 stress4 ...

given a stress value, I can get the range. If the given stress is between stress3 and stress4 I can print out the line they came from, their column numbers and their values, but I have yet to figure out how to use that information to also obtain the distance values from those same columns (two rows earlier).

Any help would be appreciated.
bryan
 
What distinguishes a dist line from a stress line (or are there only 3 lines in the file)? How is the "given stress" specified? Post a small sample of the input file and I am sure someone will help you. CaKiwi
 
This will be a subroutine from another script which will pass the "desired stress" to this code.

Pretend there are only three lines in the file, but actually there are 27, but I use a for loop to look at every third line until I find a stress lower than the desired followed by a stress higher than the desired on a given line.
 
Ok, then in your loop for every first line of 3 execute the statement
Code:
  n = split($0,dist," ")
The array dist will then contain the dist values, i.e. dist[1] will contain the first value, dist[2] will contain the second value up to dist[n] which will contain the nth value which you can use to match with the corresponding stress value.

Hope this helps. CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top