Jump to content

reading from csv file.


Recommended Posts

Hi,

in this attached vi, i want to read data from a csv file. The problem is, that i can not picture the right format.

In the first coloum i only get the the 19, in the second 14 and so on of 19.02.2004 13:00:00,14.5500,2.6120,423.5600,1.2561,1.9590

Couldn't upload the csv file.

Would be great, if anybody could help.

Thanks, Jennifer

Link to comment

QUOTE(jennifer @ Jan 25 2008, 06:04 AM)

Hi,

in this attached vi, i want to read data from a csv file. The problem is, that i can not picture the right format.

In the first coloum i only get the the 19, in the second 14 and so on of 19.02.2004 13:00:00,14.5500,2.6120,423.5600,1.2561,1.9590

Couldn't upload the csv file.

Would be great, if anybody could help.

Thanks, Jennifer

It would help if you'd attached a sample of your csv file.

Based on your description, processing the file as a double won't give you the proper first value as it's a timestamp and not a double. You'd have to process everything as a string array to preserve the timestamp. After that you'll have to process the strings.

Depending on what you're doing, there may be better ways of processing the csv file.

Link to comment

QUOTE(Tim_S @ Jan 25 2008, 01:12 PM)

It would help if you'd attached a sample of your csv file.

Based on your description, processing the file as a double won't give you the proper first value as it's a timestamp and not a double. You'd have to process everything as a string array to preserve the timestamp. After that you'll have to process the strings.

Depending on what you're doing, there may be better ways of processing the csv file.

Hi,

this new vi contains a few lines of the csv file. It works better now with strings. Thanks for your hint. I want to show the first two strings in a row in a diagram. How can this be realized?

Thanks for your support.

Link to comment

QUOTE(jennifer @ Jan 28 2008, 11:58 AM)

I want to show the first two strings in a row in a diagram. How can this be realized?

Jennifer,

I made a few additions to your VI. I don't know if this is exactly what you were looking for but the VI now lets you select a row then gives you the first two elements that are comma seperated.

Hope this helps.

Steve

Link to comment

QUOTE(jennifer @ Jan 28 2008, 11:58 AM)

Hi,

this new vi contains a few lines of the csv file. It works better now with strings. Thanks for your hint. I want to show the first two strings in a row in a diagram. How can this be realized?

Thanks for your support.

You could open the file and use "Read from Text File" to read n number of lines. You'll have to right-click on the primative function and check Read Lines to do this. The Spreadsheet String to Array primative would also be useful.

Tim

Link to comment

QUOTE(Tim_S @ Jan 28 2008, 07:53 PM)

You could open the file and use "Read from Text File" to read n number of lines. You'll have to right-click on the primative function and check Read Lines to do this. The Spreadsheet String to Array primative would also be useful.

Tim

Why do sara and jennifer post quite similar requests here. I get this feeling that sara learned from the reactions and now got an identity change and tries to at least show that she did a little work before asking questions. Still!!

Rolf Kalbermatter

Link to comment

QUOTE(rolfk @ Jan 29 2008, 10:55 AM)

Why do sara and jennifer post quite similar requests here. I get this feeling that sara learned from the reactions and now got an identity change and tries to at least show that she did a little work before asking questions. Still!!

Rolf Kalbermatter

That's exactly what I thought! It must either be the same person, or they have the same professor. :gathering:

Link to comment

QUOTE(Steve_Brooks @ Jan 28 2008, 07:35 PM)

Jennifer,

I made a few additions to your VI. I don't know if this is exactly what you were looking for but the VI now lets you select a row then gives you the first two elements that are comma seperated.

Hope this helps.

Steve

Hi Steve,

yes, that helps. Thanks a lot. I tried to display the values in a graph with the date as the x-scale and the temperature as the y-scale. Didn't worked out. Do you have a solutuion?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.