LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from a file and writing to another

Solved!
Go to solution

I am trying to read from an excel R.CSV format file all the data at once. Then I would like to write that same data to another file call sample test1.csv   . When the program is writing to the new file i want it to write line by line down the rows not the whole thing at once. I would also like the ability to Append the row by row or over write the data every 2-4 seconds and just have 1 row. I have attached a file and the excel data i would like to read.

0 Kudos
Message 1 of 10
(2,909 Views)

Attached file

0 Kudos
Message 2 of 10
(2,907 Views)

E,

 

Can you explain you specific question in a little more detail?  I don't understand what you are asking.  Thanks.

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 3 of 10
(2,886 Views)
I need to read the data from one file and write it to another file. I would like to read the whole file in then write to the other row one then over write row onewith row 2 the. Over write that row with the 3rd row and so for.
0 Kudos
Message 4 of 10
(2,878 Views)
So the file ill be readin may have 7 columns and 30 rows. All of that data will bw read in at once. Then when im writing to the file it will not append thw file it will overwrite. So for example: it will write row one then 5 seconds later over right row 1 and write row 2 to the file so the new file only have 1 row at all time
0 Kudos
Message 5 of 10
(2,877 Views)

E,

 

Below are links to the LabVIEW help regarding the Read From Spreadsheet File VI and the Write to Spreadsheet File VI.  These documents explain how to use these functions and what all of the inputs and outputs do.  In a quick review of the code that you posted, I noticed that you had a number of structures around the Read VI, including a queue and several while loops.  I do not believe these structures are necessary for your application.  Simply use the VI once instead of calling it multiple times.  It will read the entire file in when you call it.  Also, when you use the Write VI if you wire a false to the append to file? input then it will automatically overwrite for you.  So just write a 1D array to the file and overwrite what's already there to accomplish what you are wanting to do.  I hope this helps.

 

Read From Spreadsheet File

 

Write to Spreadsheet File

Josh B
Applications Engineer
National Instruments
Message 6 of 10
(2,866 Views)
Solution
Accepted by topic author *E*
Joshua-B thanks for your reply. This helps.
0 Kudos
Message 7 of 10
(2,854 Views)

These Links arent working.

0 Kudos
Message 8 of 10
(2,818 Views)

You are correct.  The links are not good.

 

In the meantime, you may want to have a look at this link.  THere is a wealth of knowedge in there.

 

http://forums.ni.com/t5/BreakPoint/Excel-Board/td-p/379682

 

BTW, you may want to unmark your post as being solved.  It may cause people to skip over further posts.

0 Kudos
Message 9 of 10
(2,810 Views)

Sorry about that.  Here they are again.

 

Read From Spreadsheet File

http://zone.ni.com/reference/en-XX/help/371361J-01/glang/read_from_spreadsheet_file/

 

 

Write to Spreadsheet File

http://zone.ni.com/reference/en-XX/help/371361J-01/glang/write_to_spreadsheet_file/

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 10 of 10
(2,777 Views)