04-25-2024 03:42 PM
Hi Guys,
I have a 2D array with Number, date, and two different columns with time (hr:mm:sec). The CSV file is showing the header and the data but the hour portion is not coming to the file.
Can anyone suggest me the solution?
04-25-2024 06:43 PM
What you see on Excel is not what exactly is stored in CSV, Excel attempts to figure out the data in the column and applies formatting. Due to that you may think the data is not stored in the CSV but the reality is the Excel is not showing the data properly.
The right way to verify content of CSV is to open it in a text editor like Notepad++ which does not change the display format.
04-25-2024 10:46 PM
The first proper hr:mm:sec is from Labview array actually which is passed to write delimated file function of Labview to write CSV file.
04-25-2024 11:41 PM - edited 04-25-2024 11:42 PM
Commonly used separator for csv is usually ";", then Excel will open files properly:
Note that 26-Apr-24 converted to 26. Apr 24, because I have German localization.
If you would like to avoid this, just add space before:
and if you would like to avoid this warning
then obviously use year, including the century:
Hope it helps.
Please next time attach VI and not jpeg screenshot.
04-26-2024 12:13 AM
Thanks a lot. Actually, my problem was the time stamp (03:24.43.00) was coming as (24.43.00) leaving the hour (03:).
04-26-2024 12:48 AM
@Hk637 wrote:
Thanks a lot. Actually, my problem was the time stamp (03:24.43.00) was coming as (24.43.00) leaving the hour (03:).
In my example, the timestamp appears correctly in Excel.Unfortunately, it's hard to reproduce on my side because the comma "," is the decimal separator on my OS. In your case, it could be different. This is a reason why I recommend using the semicolon ";" as the separator instead, as this should solve the problem on your side as well. Just try it. Or do you have a specific reason to use the "," separator?