Adsense

read data from excel using python pandas

from __future__ import print_function
import pandas as pd
import threading, paramiko, os, time
import mysql.connector
import re
import datetime as dt
from dateutil.relativedelta import relativedelta
import json
import subprocess
import sys
from collections import OrderedDict
from json import loads, dumps


xls = pd.ExcelFile("C:\Users\kmuthuk2\Desktop\stable_scripts.xlsx")

sheetX = xls.parse("Sheet1") #2 is the sheet number

print (sheetX.columns)
var1 = sheetX['Script Name']


myresult_cvs = OrderedDict()
for i in range(100,165):
    output2=""
    print (i,var1[i]) #1 is the row number...
    cmd = 'find ./  -name '+var1[i]
    connection.send_shell(cmd)
    time.sleep(10)
    output=""
    if connection.shell.recv_ready():
     
        output = connection.shell.recv(50000).decode(encoding='utf-8', errors='ignore')
        output=output.strip().replace(cmd,"")
        output=PROMPT_REGEX.sub("",output)
        output=output.strip().split("\n")
        print ("output {}".format(output))
        if (len(output)==2):
            cmd_cvslog = 'cvs log '+output[1]
            test_full_path = output[1]
        elif (len(output)==3):
            cmd_cvslog = 'cvs log '+output[2]
            test_full_path = output[2]
        else:
            cmd_cvslog = 'cvs log '+output[0]
            test_full_path = output[0]
     
        print ("i is {}".format(i))
        print ("cmd_cvslog {} ".format(cmd_cvslog))
     
        connection.send_shell(cmd_cvslog)
        time.sleep(15)
     
        if connection.shell.recv_ready():
            output2 = connection.shell.recv(50000).decode(encoding='utf-8', errors='ignore')
            output2=output2.strip().replace(cmd_cvslog,"")
            output2=PROMPT_REGEX.sub("",output2)
            #output2=output2.strip()
            print ("output2 {} ".format(output2))
            result=re.findall(CVSLOG_REGEX,output2)
       
            print('this is result')
            print(result)
         
            result = result[0]
         
            print('this is result[0]')
            print(result)
         
            date_regex = r'date:\s+([^;]+?);'
            mydate = re.findall(date_regex,result)
            print(mydate)
            myresult_cvs[test_full_path]=result
         
       
            print ("^"*25)
   
            print ("^"*25)
    #connection.shell.flush()

print ("myresult_cvs {}".format(myresult_cvs))
print ("myresult_cvs {}".format(loads(dumps(myresult_cvs))))

13 comments:

  1. one of the best blog post, I have seen you are really good. I will recommend your website to my all friends.

    Thank you for helping

    English Speaking Course In Noida

    ReplyDelete
  2. Thanks for sharing such a great information with us. Your Post is very unique and all information is reliable for new readers.
    Keep it up in future, thanks for sharing such a useful post.
    Python training program is most important for the students in education. It is the popular programming language for education software.
    Python is the primary programming language.The students who need to get more knowledge about this language must go for the training.


    Python Training In Greater Noida
    Python Coaching in Greater Noida
    Python Course in Greater Noida

    ReplyDelete
  3. Thanks for sharing such a great information with us. Your Post is very unique and all information is reliable for new readers.
    Keep it up in future, thanks for sharing such a useful post.
    C/C++ Training is particularly basic to anyone who needs to be a programmer.
    Regardless of whether you want to enhance your insight in specific zones or searching for a course to upgrade your skills in coding,
    joining a C/C++ Training in Greater Noida can without a doubt help.

    C++ Coaching in Greater Noida
    C Coaching in Greater Noida
    C/C++ Training in Greater Noida
    C/C++ Classes in Greater Noida

    ReplyDelete
  4. Thanks for sharing such a great information with us. Your Post is very unique and all information is reliable for new readers.
    Keep it up in future, thanks for sharing such a useful post.
    Java has become more popular and is widely used as compared to other programming languages like Python, C/C++, C#, PHP and so on.
    Many people often ask why it is so important to learn Java Programming. Well, if it’s your concern too, the solution is simple. To know further,
    kindly take a look at below info

    Java Classes in Greater noida
    Java Training Institute in Greater Noida
    Java course in Greater Noida
    Java Training in Greater Noida

    ReplyDelete
  5. I am very glad to see this post. It is very interesting and informative. Such a nice post, i am very thankful and i like this post. Also i would like to share one thing which is an institute for learning programming languages, which is the most demanding now a day. For that, you can join at this link

    Pythan Training in Greater Noida
    Pythan coaching in Greater Noida
    Pythan institute in Greater Noida
    Pythan classes in Greater Noida


    ReplyDelete
  6. Thanks for sharing such a great information with us. Your Post is very unique and all information is reliable for new readers.
    Keep it up in future, thanks for sharing such a useful post.
    DAA Coaching in Greater Noida to improve your skill in the data structure. They offer Data Structure Classes with theory and practical classes.
    The institute has designed for the training class that depends on the preferences of candidate and needs of industry.

    DAA Course in Greater Noida
    DAA Coaching in Greater Noida
    DAA Classes in Greater Noida

    ReplyDelete
  7. Thanks for sharing such a great information with us. Your Post is very unique and all information is reliable for new readers.
    Keep it up in future, thanks for sharing such a useful post.
    you can learn an operating system course.
    It is one of the famous courses that helps you to get a good job in the IT sector. The OS training program helps to develop the drivers
    of the device in the pc platforms and embedded platforms. If you want to study the Operating System Coaching in Greater Noida then
    you can select the top coaching center. The reputed institute provides the best training to the students.

    Operating System Classes in Greater Noida
    Operating System Course in Greater Noida
    Operating System Coaching in Greater Noida

    ReplyDelete
  8. I am exceptionally happy to see this post. It is fascinating and enlightening. Such a pleasant post, I am grateful and I like this post. Likewise I might want to share one thing which is an establishment for learning Digital Marketing, which is the most requesting now daily. For that, you can join at this connection
    Digital Marketing Training in Noida
    Digital Marketing coaching in Noida
    Digital Marketing institute in Noida
    Digital Marketing classes in Noida


    ReplyDelete
  9. I am outstandingly glad to see this post. It is interesting and edifying. Such a lovely post, I am appreciative and I like this post. Moreover, I should need to share one thing which is a foundation for learning python, which is the most mentioning now every day. For that, you can join at this association

    Pythan Training in Greater Noida
    Pythan coaching in Greater Noida
    Pythan institute in Greater Noida
    Pythan classes in Greater Noida


    ReplyDelete
  10. Much obliged for sharing significant Information, I actually quite great on your blog. I trust you proceed on blogging work.
    English Spoken Training in Noida
    English Spoken coaching in Noida
    English Spoken institute in Noida
    English Spoken classes in Noida


    ReplyDelete
  11. I am very glad to see this post. It is very interesting and informative. Such a nice post, i am very thankful and i like this post. Also i would like to share one thing which is an institute for learning programming languages, which is the most demanding now a day. For that, you can join at this link

    Digital Marketing Training in Greater Noida
    Digital Marketing coaching in Greater Noida
    Digital Marketing institute in Greater Noida
    Digital Marketing classes in Greater Noida


    ReplyDelete
  12. It was very authentic information!! Loved to read this articles!! Keep it up!!
    http://www.chardhamyatra-package.com/char-dham-packages/

    ReplyDelete

comment here

newest questions on wordpress