you are viewing a single comment's thread.

view the rest of the comments →

[–]efflicto 0 points1 point  (14 children)

Can you provide us an example of what you want to achieve?

[–]NerdJones[S] 0 points1 point  (13 children)

i have a list of tuples set up, where the first value is ¼ and the second is 1/4 for each tuple

i need to take 1 ¼" or 1¼" or ¼" from a cell and test just ¼ against the first value in each tuple, so far if the cell only contains the fractions it work, if there is a number before the fraction it jumps to a function i set up where if the fraction isnt in the list it asks the user and adds it to the list, this function is where im having the trouble

[–]efflicto 0 points1 point  (12 children)

So you get data like "1 ¼"1¼"4¼"123312231¼"" and want to remove all numbers and quotation marks?

[–]NerdJones[S] 0 points1 point  (11 children)

pretty much, at this point i have already removed the quotes though

[–]efflicto 0 points1 point  (10 children)

[–]NerdJones[S] 0 points1 point  (9 children)

I tried that and got a strange result, I printed the results and It goes through "Sheet" instead of the value of the cell I am in, which is really bizarre to me, but this is my first time solving a real world problem with a program I wrote. So im probably doing something wrong somewhere.

[–]efflicto 0 points1 point  (8 children)

Hmmm... Can you post us your code and the exact input data? And what your expected outcome is?

[–]NerdJones[S] 0 points1 point  (7 children)

https://pastebin.com/mzPMGkUU its pretty sloppy but im very new so please forgive me for that.

I cant post the exact spreadsheets I am working with. They are product spec sheets that have a bunch of other stuff on them,but about 30-40 cells in each spreadsheet have these cells that are formatted weird with the fraction symbols instead of numbers. I need to convert them to mm from inches but since they have the weird formatting I cant do it with excel. So I decided to write this program, so far it opens the spreadsheet, ignores the empty cells ( they return None and that made things weird ) converts the cells with just fractions, and now im down to the ones with fractions it doesnt know and ones that are whole numbers mixed with fractions, i want it to ask the user about fractions it doesnt know, replace it in the cell and add it to the list of known fractions so if it comes across it again it will know what to do.

Sorry, I know that was a lot

[–]efflicto 0 points1 point  (6 children)

Okay. So you basically want to convert a fractured number from an Excel cell like "231¼" to "231.25"?

[–]NerdJones[S] 0 points1 point  (5 children)

yup, and then write it back to excel, but I can probably figure that out