Search Results

Search: Posts Made By: nans
Forum: Programming 07-05-2017
20,067
Posted By nans
Got it! Thank you!
Got it! Thank you!
Forum: Programming 07-05-2017
20,067
Posted By nans
Great. I've changed it to 'while cell_pos.value:'...
Great. I've changed it to 'while cell_pos.value:' and this works just perfect for my script.
Out of curiosity if I wanted to say go until all the cells E, G, and F are empty, how would I go about...
Forum: Programming 07-04-2017
20,067
Posted By nans
Got it! So I have changed it to if...
Got it! So I have changed it to

if (dict_pos.has_key(cpos)):
NG.value = dict_pos[cpos]
else:
NG.value = 'Unknown_' + datetime.now().strftime("%B") + datetime.now().strftime("%Y")
print NG...
Forum: Programming 07-04-2017
20,067
Posted By nans
okay, I'm getting there now slowly! But why isn't...
okay, I'm getting there now slowly! But why isn't it saving the results to the excel sheet ?


for sheet_root, sheet_dirs, sheet_files in os.walk(sheet_directory):
for sheet_file in...
Forum: Programming 07-03-2017
20,067
Posted By nans
Correct, those values are of (E4, G4, F4). But...
Correct, those values are of (E4, G4, F4). But with "row_no += 1", shouldnt it pick up the values from the next row ? I thought this while loop meant 'go to row 4, if the row matches the score from...
Forum: Programming 07-03-2017
20,067
Posted By nans
when I do that, then the values of cpos goes into...
when I do that, then the values of cpos goes into a loop


Scores(POS=u'73', ALT=u'G', REF=u'A')
2921689
Scores(POS=u'73', ALT=u'G', REF=u'A')
2921690
Scores(POS=u'73', ALT=u'G', REF=u'A')...
Forum: Programming 07-03-2017
20,067
Posted By nans
while cpos: if...
while cpos:
if (dict_pos.has_key(cpos)):
NG = dict_pos[cpos]
print dict_pos[cpos]
else:
...
Forum: Programming 06-30-2017
20,067
Posted By nans
Isn't the value of cpos inside the while loop ? ...
Isn't the value of cpos inside the while loop ?


while cpos:
if (dict_pos.has_key(cpos)):
NG = dict_pos[cpos]
...
Forum: Programming 06-30-2017
20,067
Posted By nans
I'm not quite sure what is going wrong, I have...
I'm not quite sure what is going wrong, I have tried this as well


while cpos:
if (dict_pos.has_key(cpos)):
NG = dict_pos[cpos]
...
Forum: Programming 06-29-2017
20,067
Posted By nans
I did use the while statement before but that...
I did use the while statement before but that just printed the value of the score continously without stopping. This is what I did


NG = ws[score_col_no + str(row_no)] = 'Unknown_' +...
Forum: Programming 06-28-2017
20,067
Posted By nans
Thank you. Its just that this language is quite...
Thank you. Its just that this language is quite new and I am happy to learn it (just a bit slow!) So based on all your inputs, I have modified the code a bit more, now it prints the correct score...
Forum: Programming 06-27-2017
20,067
Posted By nans
I'm using Libre Office, an older version, not...
I'm using Libre Office, an older version, not microsoft excel. So what would be the appropriate way of calling E4:G4:F4 -> V4

What do you mean by point 2 ? Will.it then be
dpos =...
Forum: Programming 06-27-2017
20,067
Posted By nans
Ah no worries. If I remove that, then what...
Ah no worries.

If I remove that, then what would be the best way to proceed further


#dpos = get_text_data(sheet_file.replace('.xlsx', '.txt'))
sheet_xl_file =...
Forum: Programming 06-27-2017
20,067
Posted By nans
Thank you. yes, i was using the wrong column!...
Thank you.
yes, i was using the wrong column! Now this is my final code


#!/usr/bin/python

import sys
import os
from openpyxl import load_workbook
from datetime import datetime
from...
Forum: Programming 06-26-2017
20,067
Posted By nans
Thank you! That makes sense. So now when I print...
Thank you! That makes sense. So now when I print dict_pos, it seems to have formed a dictionary (not posting all of it as its large

/usr/bin/python2.7 /home/test/annotate.py
S12.xlsx
{'4300':...
Forum: Programming 06-26-2017
20,067
Posted By nans
Following your suggestion, now I get these errors...
Following your suggestion, now I get these errors
All the files and codes are running in the same directory. I've also made sure the xlsx has permissions.

Traceback (most recent call last):
...
Forum: Programming 06-25-2017
20,067
Posted By nans
No error msg.
No error msg.
Forum: Programming 06-24-2017
20,067
Posted By nans
It still doesn;t work for me. the code runs but...
It still doesn;t work for me. the code runs but doesn't give any output at all or print 'dict_pos'. I have attached the code I am using now.



#!/usr/bin/python

import sys...
Forum: Programming 06-23-2017
20,067
Posted By nans
1) When you tried my code with a bit of...
1) When you tried my code with a bit of manipulation, did you ensure that it reads the file "scores.txt" and not "S12.txt" for the Excel file "S12.xlsx" ?
Yes. its only one file 'scores.txt' that...
Forum: Programming 06-23-2017
20,067
Posted By nans
Thank you. But I think i've not explained...
Thank you.

But I think i've not explained myself properly. the code I provided was just a more complicated way which did not seem efficient.

There is only one text file for scores with 4...
Forum: Programming 06-22-2017
20,067
Posted By nans
The code is very long, I have attached the...
The code is very long, I have attached the relevant part where I am trying to copy the contents of the text file into the excel worksheet. But using this as well, I end up with a blank worksheet.
...
Forum: Programming 06-21-2017
20,067
Posted By nans
Appending a column in xlsx file using Python
Is there a way to append an existing xlsx worksheet to add data from a text file ?
I have an excel file for which I need to manipulate the first worksheet based on a text file.
I match the text...
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy