Page 1 of 1

using data on a csv file

Posted: June 27th, 2023, 7:46 pm
by Jason37
salut je suis nouveau sur cspro et j'ai eu un code qui permet la saisie des données sur un document csv vers mon masque de saisie mais j'arrive pas le modeler pour qu'il soit compatible avec mon autre fichier csv

Re: using data on a csv file

Posted: June 29th, 2023, 11:48 am
by justinlakier
Under "Tools", excel2cspro can help reformat your .csvs into more usable cspro lookup files using a dictionary based on how you want your sample to look. Your input/output data should be stored in .csdb files as well. If you do need to use text files, they should have the .dat extension. Using CSPro formats rather than reading and writing directly to a .csv every time should save a lot of complexity and allow you to format your data how you like, then convert data back to a .csv format later.
You can improve your code by using "string" instead of "alpha(50)" for csvFileArray, and clear it with array.clear() instead of looping, but you likely won't need the array if you can simply load to and from a csdb file.

I hope that helps,
Justin

Re: using data on a csv file

Posted: June 29th, 2023, 2:24 pm
by Jason37
This should make it easier and I did eventually find the solution so thanks for the help