Search Results

Search found 12 results on 1 pages for 'kdev'.

Page 1/1 | 1 

  • get previous line in jython

    - by kdev
    I wanted to write the line of previous line of the searched string .how can i do that Lets say my two lines are AADRG SDFJGKDFSDF and i am searching for SDF and found out SDFJGKDFSDF but how can i get previous line AADRG does file.readline()-1 works . Please suggest Thanks

    Read the article

  • String search and write into file in jython

    - by kdev
    hi Everyone , i wish to write a program that can read a file and if a particular str_to_find is found in a bigger string say AACATGCCACCTGAATTGGATGGAATTCATGCGGGACACGCGGATTACACCTATGAGCAGAAATACGGCCTGCGCGATTACCGTGGCGGTGGACGTTCTTCCGCGCGTGAAACCGCGATGCGCGTAGCGGCAGGGGCGATCGCCAAGAAATACCTGGCGGAAAAGTTCGGCATCGAAATCCGCGGCTGCCTGACCCAGATGGGCGACATTCCGCTGGAGATTAAAGACTGGCGTCAGGTTGAGCTTAATCCGTTTTC then write that line and the above line of it into the file and keep repeating it for all the match found. Please suggest i have written the program for printing that particular search line but i dont know how to write the above line. Thanks everyone for your help. import re import string file=open('C:/Users/Administrator/Desktop/input.txt','r') output=open('C:/Users/Administrator/Desktop/output.txt','w') count_record=file.readline() str_to_find='AACCATGC' while count_record: if string.find(list,str_to_find) ==0: output.write(count_record) file.close() output.close()

    Read the article

  • inserting number into oracle sql - using jython

    - by kdev
    I have this insert command where iam trying to insert a number to be taken from loop i=0 for line in column: myStmt.executeQuery("INSERT INTO REVERSE_COL ( TABLE_NAME,COL_NAME,POS) values (,'test','"+column[i]+"','"+i+"'") i=i+1 POS IS NUMBER DATATYPE but it works if i hard code as 1 i=0 for line in column: myStmt.executeQuery("INSERT INTO REVERSE_COL ( TABLE_NAME,COL_NAME,POS) values (,'test','"+column[i]+"',1") I have tried only i , +i+ and other method but its not working any suggestion how to solve this . Thanks everyone .

    Read the article

  • one variable for all the sql output

    - by kdev
    hi everyone myRs=myStmt.executeQuery("select i_col,col_name from tab_col") i=0 while (myRs.next()): list= myRs.getString("I_COL")+','+myRs.getString("COL_NAME") i have a jython code to run a sql statement i want to store all the row of the sql into a single variable. I used to list to store the value but its always storing only the single line , so is there is way to append all the rows and keep adding to single variable. Thanks so much for your help.

    Read the article

  • Getting the previous line in Jython

    - by kdev
    I want to print the line immediately before the searched string. How can I do that? Lets say my two lines are AADRG SDFJGKDFSDF and I am searching for SDF. I have found SDFJGKDFSDF, but how can I obtain the previous line AADRG? Does file.readline()-1 work?

    Read the article

  • Breaking the loop in Jython

    - by kdev
    Hi everyone, I have a written a loop for and if condition and I want to break to loop completely when if gets satisfied. while count: i=0 for line in read_record: #print str.strip(count[1:28]) #print str.strip(read_record[i]) if string.find(str.strip(read_record[i]),str.strip(count[1:28]))>0: code=str.strip(read_record[i+19])+str.strip(read_record[i+20]) print code[25:] break i=i+1 So here if the if string.find condition gets satisfied I want to go to while loop flow. Please tell me what will be the best place to break and how should I modify the program so that once the if condition is satisfied I am out of the loop and start again with while loop.

    Read the article

  • call a jython file from another program

    - by kdev
    Hi everyone, can i call a jython file from another jython program and execute that . Also i know os.system(cmd.exe)get the system prompt . is it possible that i can trigger cmd.exe and cmd.exe gets poped up into the screen. Thanks

    Read the article

  • getting complete sql query in jython

    - by kdev
    result=sqlstring.executeQuery("select distinct table_name,owner from all_tables ") rs.append(str(i)+' , '+result.getString("table_name")+' , '+result.getString("owner")) If i want to display the query select * from all_tables or ' select count(*) from all_tables' how can i get the output to display . Please suggest thanks

    Read the article

  • next line in jython

    - by kdev
    Hi everyone , count_record=file.readline() count_prev=count_record[:-1] , i used this to read the previous line and it worked but now when i am using count_next=count_record[:+1] i am not able to read the next line , is there is way to do so read the next time . Thanks for your help

    Read the article

  • breaking the look in jython

    - by kdev
    Hi everyone , I have a written a loop for and if condition and i want to break to loop completely when if gets satisfied. while count: i=0 for line in read_record: #print str.strip(count[1:28]) #print str.strip(read_record[i]) if string.find(str.strip(read_record[i]),str.strip(count[1:28]))>0: code=str.strip(read_record[i+19])+str.strip(read_record[i+20]) print code[25:] break i=i+1 so here if the if string.find condition gets satified i want to go to while loop flow. Please tell me what will be the best place to break and how should i modify the program so that once the if condition is satified iam out of the loop and start again with while loop .

    Read the article

1