I have a file containing two fields with 154 rows/records/lines (forgive me, my UNIX terminology is not quite up to par yet). I am trying to read from this list, find a value (lets say 0), then print the record/line/row that value falls on (In this case it would be record/line/row #27)? Here is an example of the type of file Im dealing with...
I thought perhaps awk might do the trick, but I suspect there might be something better, and frankly, I havent a clue as to how to solve this problem. Any help would be greatly appreciated!
Thanks for your solution, it's is really close to what I need, but...I actually need the line number that the value 0 falls on, in my example it was line #27, the value 0 is is just the criterion if you will.
This list represent points in time (in total 154) within fMRI data, the values in field $1 represent deviations from baseline within those points in time, basically head movement by the subject. The value 0 is significant because it represents no such deviations from baseline. The line number that that 0 falls on is important because it represents a specific point within the temporal sequence of the fMRI scan in which the subject wasn't moving. I take that value (the line number) and input it into another program so that it can properly register the entire fMRI dataset. To further complicat things, this 0 value will be different for every subject and every fMRI scan.
Danmero your brilliant! Thank you so much for your help! This is exactly what I needed.
This solution was a lot simpler than I expected, I am rather little embarrassed I didnt come up with this myself. All the same, I really appreciate your help.