Tuesday, May 24, 2016


R packages installation error solved

  • Tuesday, May 24, 2016
  • Most of the common error we are getting below  in R at the time of installing in R packages like(rJava,ggplot2...)

    Warning message:
    package ‘rJava’ is not available (for R version 3.0.2)

    In this post we ll see how to resolve this error.

    First login as root user 
    and type R and you ll get r prompt

    then type 
    it ll ask package mirror location give any one it ll installed without any issue.

    To confirm the package installation 
    try below line
    It won't throw any message so its installed .


    Thursday, April 28, 2016


    Install R in Redhat 7.2

  • Thursday, April 28, 2016
  • Installation of R in redhat is simple.
    First download the below file

    wget http://public-yum.oracle.com/public-yum-ol7.repo

    open the downloaded file and change enabled property into 1
    vi public-yum-ol7.repo

    enabled = 1

     sudo yum install R.x86_64

    Now R is installed.. 
    typr R you ll get 


    If you are getting below error 
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle"

    Try the below command to download oracle gpg file
    wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    sudo yum install R.x86_64
    issue has resolved..


    Friday, January 29, 2016


    Convert Excel file data in to comma seperated text file

  • Friday, January 29, 2016

  • Below code is to convert excel file (name.xls) in to text files sepetated values by comma.
    In my name.xls file contains 6 columns and 20 rows (20 student informations) it has two different school details in sheet1 and sheet2

    package com.excel.upload;

    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import jxl.Cell;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;

    public class ExcelRead {

    public static void main(String[] args) {
           try {
                Workbook wrk1 =  Workbook.getWorkbook(new File("C:\\Users\\jayakumark\\Downloads\\test1.xlsx"));
               //i for number of row ,j for column , k for number of sheets in excel bassed on that you can change i, j, k values  here i am using 2 sheets
                int i,j,k;
               Sheet sheet1 = wrk1.getSheet(k);            
               for (i=0;i<20;i++)
                String [] crits = new String [6];
                for (j=0;j<=5;j++)
                     Cell colArow1 = sheet1.getCell(j, i);      
                     String str_colArow1 = colArow1.getContents();
                      crits[j] = str_colArow1;
                //to print those values in text file
                   OutputStreamWriter writer = new OutputStreamWriter(
                         new FileOutputStream("C:\\Users\\jayakumark\\Downloads\\DB_input_excel\\name.txt", true), "UTF-8");
                   BufferedWriter fbw = new BufferedWriter(writer);
               }catch (Exception e) {
                   System.out.println("Error: " + e.getMessage());
               System.out.println("Contents of cell Col A Row 1: " +crits[1]);
           } catch (BiffException e) {
           } catch (IOException e) {



    here i -> number of rows
    j-> number of columns
    k -> number of sheets in excel
    if you have 5 sheets in your excel file you have to increase k value.
    Finally you will get all sheet values in a single text file .

    To use this code you should download and add below jar in your eclipse.