Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
WithYou can use awkperl:
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
$ 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
$ 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