rhnaeco
Technical User
- Aug 11, 2005
- 45
I have lots of files with several hundred rows and columns.
I would like to substitute one line and keep the others as is. For that line I would like to add 0.8 to each column
input:
a,s,d,f,g,h
1,2,3,4,5,6
ed,rf,hg,rt,fg,kj
output:
a,s,d,f,g,h
1.8,2.8,3.8,4.8,5.8,6.8
ed,rf,hg,rt,fg,kj
but only if there is something in that column as some columns are empty (always the first 10 columns, and last 4)
I'm pretty sure sub and NR play some part but I'm not sure how to do it and make sure the rest of the file is untouched.
any help is much appreciated
R
I would like to substitute one line and keep the others as is. For that line I would like to add 0.8 to each column
input:
a,s,d,f,g,h
1,2,3,4,5,6
ed,rf,hg,rt,fg,kj
output:
a,s,d,f,g,h
1.8,2.8,3.8,4.8,5.8,6.8
ed,rf,hg,rt,fg,kj
but only if there is something in that column as some columns are empty (always the first 10 columns, and last 4)
I'm pretty sure sub and NR play some part but I'm not sure how to do it and make sure the rest of the file is untouched.
any help is much appreciated
R