Skip to main content
added 31 characters in body
Source Link
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

WithYou can use awkperl:

$ awkperl '{$1-MPOSIX=ceil -anle '$F[0] = sprintfceil("%.0f", $1$F[0]/65)}1';print "@F"' file
24 C_P.doc
11 C_M.doc
14 G_S.doc
15 J_Z.doc
24 J_M.doc
2627 L_B.doc

With awk:

$ awk '{$1 = sprintf("%.0f", $1/65)}1' file
24 C_P.doc
11 C_M.doc
14 G_S.doc
15 J_Z.doc
24 J_M.doc
26 L_B.doc

You can use perl:

$ perl -MPOSIX=ceil -anle '$F[0] = ceil($F[0]/65);print "@F"' file
24 C_P.doc
11 C_M.doc
14 G_S.doc
15 J_Z.doc
24 J_M.doc
27 L_B.doc
Source Link
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

With awk:

$ awk '{$1 = sprintf("%.0f", $1/65)}1' file
24 C_P.doc
11 C_M.doc
14 G_S.doc
15 J_Z.doc
24 J_M.doc
26 L_B.doc