Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert number to a char string
Message
From
09/12/2019 13:39:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01672170
Message ID:
01672205
Views:
52
>>>Hi Antonio,
>>>
>>>Here is the explanation. Some customers have cost centers as numbers (e.g. 800.0045) but my program has a table where these cost centers are characters (e.g. "800.0045") (because different customers have a different pattern of values).
>>>I was converting from an excel spreadsheet that customer sent me to my table. I was trying to create a generic code that would work with any set of values.
>>>And thank you for the sample code.
>>
>>Ok, Dmitry, it's becoming clearer to me. If I got it completely right, you must respect whatever string of characters the Excel file has in the cell / column that holds the cost center id and insert it as a character in your table.
>>
>>Can you export the Excel data to CSV and just then append the rows to your tables, in that way enforcing the target type as character instead of number?
>
>Yes, I suppose I can export the excel to CSV. But I found that using the library created by Greg Greene makes it easier. Since I can do it all in once step, code that directly converts the excel to a DBF table.
>Thank you.

I had suspicion that this "database" was source of the problem. Forcing some columns into string early on helps a lot for other tight places like leading zeroes deleted from strings meant as phone numbers / area or cell prefix code...

And yes, with some clients you do not have any pull and sometimes clients trick cells out of string interpretation
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform