Hi

I have a script that is looking up multiple files, the files have a consistent layout they are a notepad from a CSV file. In some files there is a number and in some files there is a text. i have created a dictionary that one of the items is: {'A':float (data[-1][5])}.
The issue is when there is a number it is fine and it recognizes the number however when there is a text say "Car" it returns a error. Do I need to write a If/Elif statement to get around this and if I could get some assistance on what it would need to say that would be handy.

When referencing the cell from the file I need the ability to show the text and if it is a number to show this

ta

Jezza

Why you must convert it to float, how are you using it? You can not use 'Car' same as float.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.