From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Spreadsheet To File even if path doesn't exist (yet)

Solved!
Go to solution

I am interested in using Write Spreadsheet To File to log some data to my disk.  What is the easiest way to include this VI and tell it to create the folders if they don't already exist.

 

For example:

 

data.png

 

Using that example, if no "Data" folder can be found on my Desktop, how can I have LabVIEW create the "Data" and "Test1" folders necessary to create Test1.csv in the specified location?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 1 of 8
(2,940 Views)
Solution
Accepted by topic author MrHappyAsthma

I ended up making a VI out of this community example https://decibel.ni.com/content/docs/DOC-23385

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 2 of 8
(2,911 Views)

Is it possible to share your VI as I am unable to reach the link.Thanks

KInd regards,
Waleed El-Badry, MSc., CLAD MCPD
0 Kudos
Message 3 of 8
(1,787 Views)

Just use the Create Folder Function instead.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(1,781 Views)

@wbadry2 wrote:

Is it possible to share your VI as I am unable to reach the link.Thanks


Examples got moved around fairly recently.  So I'm not surprised if the link doesn't work.  See if this fixes your issue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 8
(1,778 Views)

Or use \vi.lib\Utility\libraryn.llb\Create Directory Recursive.vi

0 Kudos
Message 6 of 8
(1,776 Views)

@UliB wrote:

Or use \vi.lib\Utility\libraryn.llb\Create Directory Recursive.vi


Which can now (at least as of 2019) be found in the File I/O->Advanced File Functions palette.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(1,773 Views)

So what's the difference between the Create Directory Recursive function and the Create Folder function?  They both seem to create the intermediate folders on the way to creating the target folder.  Curious as to why they both exist...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(1,752 Views)