07-13-2009 12:37 AM
Hi there,
We have a very simple question. We are trying to read ONLY the second colume of a text file using the "read from spread sheet.vi" and we are having difficulty doing this. The text file looks like the one attatched. We can't read the second colume because it is seperated by ",". At this moment we can only read the first colume.
Is there any other vi that can do this or can we just modify the "read from spread sheet.vi".
Can someone help us. Please!
Thank you.
07-13-2009 12:50 AM
Hi conchita,
you can use the "read from spreadsheet file" function. Use a "," as delimiter. The result is a 2d array. You can use "index array" to get only the second column.
Mike
07-13-2009 08:35 AM
07-13-2009 09:13 PM - edited 07-13-2009 09:22 PM
hi mike
Thank you very much for your help....
07-13-2009 09:20 PM
Hi Jim,
Thanks for your help. Your program does exactly what we were trying to do.
07-13-2009 11:04 PM
Hey,
Using your code we can get the 2nd colum of the text file and store it into an array. However now we are trying to save that data into an Excel file, in B2 cell. We are finding it difficult to do this.
We searched on the forum and found the following website, which we thought was helpful. But even with the help of the forums we couldn't manage to save the date on an actual Excel file.
Can you please help?
Thank you
http://forums.ni.com/ni/board/message?board.id=170&message.id=378727&query.id=847333#M378727
07-14-2009 12:33 AM
Hi conchita,
the link shows no function to write into a real excel file. You need ActiveX to do that. See this link for some ActiveX functions.
Mike
07-14-2009 02:19 AM - edited 07-14-2009 02:20 AM
Hey Mike,Thanks a lot for all your generous help. It’s really nice of you to provide us with so much assistance. This is what we are trying to achieve. We are getting a vast amount of data in the in the file DATA123 format (attached before). So we want to create ONE big file with all the dBm values. This is what we thought we should do to achieve this:
1. Open each of the files (at a time) and read of the 2nd column ( the code given by you)
2. Paste it into a new file.
3. Open a new file (formatted in the same way as DATA 123)
4. Again copy the 2nd column.
5. Paste it next to the existing set of data in the new file. [separated by “,” or space.]
We were trying to do it in a text file. We have added some vi to it. However it does not work at all. We hope that we have explained the problem to you clearly and also hope that it is not too much trouble for you . WE really appreciate ALL YOUR HELP.
THANK YOU.
07-14-2009 04:06 AM
Hi conchita,
the attached picture shows two solutions. The first stores all your data in one column, the second build an array where each column is the data from a new file.
Mike
07-14-2009 07:56 AM