Skip to main content
added 66 characters in body
Source Link

I would like to add a new column to an existing matrix in file.txt using awk. I have the file

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

and I would like to have something like this

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

O and H have to vary systematically in this form 100's of times.

Somebody knows how to do it with awk? Thanks in advance

I would like to add a new column to an existing matrix in file.txt using awk. I have the file

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

and I would like to have something like this

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

Somebody knows how to do it with awk? Thanks in advance

I would like to add a new column to an existing matrix in file.txt using awk. I have the file

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

and I would like to have something like this

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

O and H have to vary systematically in this form 100's of times.

Somebody knows how to do it with awk? Thanks in advance

deleted 26 characters in body
Source Link

I would like to add a new column to an existing matrix in file.txt using awk. I have the file

Blockquote

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

Blockquote

and I would like to have something like this

Blockquote

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

Blockquote

Somebody knows how to do it with awk? Thanks in advance

I would like to add a new column to an existing matrix in file.txt

Blockquote

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

Blockquote

and I would like to have something like this

Blockquote

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

Blockquote

Somebody knows how to do it with awk? Thanks in advance

I would like to add a new column to an existing matrix in file.txt using awk. I have the file

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

and I would like to have something like this

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

Somebody knows how to do it with awk? Thanks in advance

Source Link

Adding a column to a three columns file with awk

I would like to add a new column to an existing matrix in file.txt

Blockquote

  -1.664405      -0.019498       0.487501
  -2.210156       0.326547       1.193717
  -2.260318      -0.104277      -0.256821
   2.189078      -2.103898       1.321050
   1.558565      -1.476110       0.967988
   1.764428      -2.955372       1.216211
   ...
   ...

Blockquote

and I would like to have something like this

Blockquote

O     -1.664405      -0.019498       0.487501
H     -2.210156       0.326547       1.193717
H     -2.260318      -0.104277      -0.256821
O      2.189078      -2.103898       1.321050
H      1.558565      -1.476110       0.967988
H      1.764428      -2.955372       1.216211
    ...
    ...

Blockquote

Somebody knows how to do it with awk? Thanks in advance