print every nth line

2011-03-01 2 min read Bash Linux

Some time back I was working with lot of data and wanted to analyze only the every 10 line sometimes and sometimes every 20th line. I had to keep doing these changes in vim or otherwise so finally I wrote a program to do this for me. If you need such a program then here it is:

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> #          FILE:  print_nth_line.sh<br /> #<br /> #         USAGE:  ./print_nth_line.sh<br /> #<br /> #   DESCRIPTION:  Print every nth line<br /> #<br /> #       OPTIONS:  ---<br /> #  REQUIREMENTS:  ---<br /> #          BUGS:  ---<br /> #         NOTES:  ---<br /> #        AUTHOR:   (),<br /> #       COMPANY:<br /> #       VERSION:  1.0<br /> #       CREATED:  12/08/2010 05:36:53 PM IST<br /> #      REVISION:  ---<br /> #===============================================================================<br /> <br /> if [ x"$1" == "x" ]<br /> then<br /> echo "Please provide the line numbers to print .. .ex 3 will print 3,6,9"<br /> exit -1;<br /> fi<br /> if [ x"$2" == "x" ]<br /> then<br /> echo "Please provide the filename"<br /> exit -2;<br /> fi<br /> awk 'temp++ { if ( temp % '$1' == 0) print $1};' $2
    </div>
  </td>
</tr>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Enhanced by Zemanta

Photo Editing with nice border and preparing for print.

2010-11-02 3 min read Fedora Photo

Working with photos in Linux is very easy with lots of viewers/editors/managers and what not. Not that there are not many options in Windows but most of them are not free. BEST case scenario is that you might get a evaluation version (i.e. if you do not use pirated/cracked version) of software‘s. Me, being completely against pirated and cracked version or evaluation version (if not, planning to buy the same) like the freedom of choice with Linux.

Continue reading

[Movie Review]RANN- predictable from Puttu

2010-03-14 3 min read Uncategorized

IdealisticHarshvardhan mallik(<span style="font-size: medium;"> <span style="color: #ff420e;">B) and his son Jay(<a class="zem_slink freebase/en/sudeep" title="Sudeep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sudeep">Sudeep), find their channel loosing out on <span style="color: #9999ff;">popularity ratings for a rival <span style="color: #7e0021;">channel smartly run by his X-employee <a class="zem_slink freebase/en/mohnish_behl" title="Mohnish Behl" rel="imdb" href="http://www.imdb.com/name/nm0046894/">Mohnish Behl. Jay is provoked and hence in an attempt to rebuild and regain the foothold,he <span style="color: #00ae00;">plans a <a class="zem_slink freebase/en/sting_operation" title="Sting operation" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sting_operation">sting operationwith aspiring PM **<span style="color: #280099;">Manoj Pandey**(<a class="zem_slink freebase/en/paresh_rawal" title="Paresh Rawal" rel="imdb" href="http://www.imdb.com/name/nm0712546/">Paresh Rawal) and his <span style="color: #00cccc;">Co-Bro industrialistRajat Kapoor. Everybody gets their share,but end up <span style="color: #0099ff;">gobbling the truth. How is that revealed and what are their<span style="color: #94bd5e;">repurcussions forms the rest.

Continue reading