Sorry for not being more clear. The input data is on the left, the output data on the right. This is a case of multiple records per individual (given by field $1). For simplicity, I've just shown a small (most relevant) portion of the data. I'd like to repeat the first value of field $2 in...
For every set of i in $1, I'd like to have the first element of $2 appear in the remaining elements of $2. This process would repeat for each i in $1.
I.e.:
The data looks roughly This is what I'd like to have it look like:
like this:
2 30 2 30...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.