Create a new list under conditions from an existing one

I have an external file (data.out) which I read it with Mathematica using

data = ReadList[“data.out”, Number, RecordLists -> True];

This file contains three columns (x,y,f) of thousands of data. Here is a small sample of it:

0.30000000 0.00000000 0.1679035061279048E+02
2.30000000 0.50000000 0.1195447110986367E+01
0.10000000 0.00000000 0.2179035061279048E+02
5.80000000 2.50000000 0.7195447110986367E+01
3.00000000 0.00000000 0.4679035061279048E+02
7.90000000 7.50000000 0.1195447110986367E+01
4.70000000 2.00000000 0.8679035061279048E+01
1.20000000 4.50000000 0.2195447110986367E+01

Now I want to use Mathematica in order to manipulate the data list creating a new one dataMod which will have this structure (x,y,f,f1). Obviously, there is a new element (f1) in the dataMod list. Well, if 0≤f<50\leq f < 5, f1f1 should be a random number in the interval 10−4= 7, RandomReal[{10^(-12), 10^(-7)}]
]
dataMod = {##, f1[#3]} & @@@ data (* Kuba’s version *)

Or in the final step

dataMod = {Sequence @@ #, f1[#[[3]]]} & /@ data (* Old version *)

It’s a good idea to include what you’ve tried to do, so it shows you’ve made some effort to solve the problem yourself. Also when you want to include data you should include it as a list, in this case it’s irrelevant that it was a file of that format to begin with.

hm, 52 seconds 🙂
– Pinguin Dirk
Aug 24 ’13 at 14:18

@PinguinDirk Yup XD
– C. E.
Aug 24 ’13 at 14:18

deleted mine, same idea, next time it’ll be mine 🙂
– Pinguin Dirk
Aug 24 ’13 at 14:19

@PinguinDirk Ah ok, that was gracious. I didn’t expect that, I will remember it for the next time 🙂
– C. E.
Aug 24 ’13 at 14:20

1

Instead of Sequence you can {##, f1[#3]} & @@@ data 🙂
– Kuba
Aug 24 ’13 at 15:19