LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update file name

Hi Nishant,

I will check it out and post what i find..

So you are saying that if you have a filename such as myData.xls, that it does not create myData1.xls?

Hummm..... strange..

I'll reply soon..

Ray

Message 21 of 94
(2,395 Views)
Nishant,

Creating a file with an extension such as .xls does not make the file and Excel formatted file. The extension merely tells the OS what application to use to attempt to openthe file. If the file is not formatted correctly the application may fail to open it. Is this what you were asking?

Lynn
0 Kudos
Message 22 of 94
(2,392 Views)

Hi Nishant,

Did you have an existing file in the target directory that had the ".xls" extention?  Because it works here for any type of extention..

For the last example, if you want to use a file with an extention, then the folder must have at least one file with the extention.  I will create a feature to add a user defined extention to the front panel and call it "Add Extention".  I will post the vi soon.

Ray

Message 23 of 94
(2,392 Views)

Attached is rev 2 of the example.

It will now create a new folder (directory) as well as a new file and also give it the desired extention.

I have to run to a meeting, so I will provide an explanation of how to use it later... (sorry... gatta run).

Have fun 😄

Ray

Message 24 of 94
(2,388 Views)

I just opened the front panel of rev 2.  I immediately noticed my c/p message in the "Create Extention" string control.  It should read "Optional Extention". 

Let's go through the Front Panel, step by step..

A. Select Option:
You have a choice of "Hardcoded Folder" or "Run-Time Selection"

1.  Hardcoded Folder:  You MUST fill in the folder name in the path control located below the switch.  It must inlcude the FULL path, such as::     C:\LV_Example
If the path does not exist, it will prompt you to create it (Create/Cancel).  If you select Cancel, it will exit the vi.  If you selected "Create", it will create both the folder and the file.
The benefit of this selection is that the operator is not asked for the folder location each time the vi is run.

2. Run-Time Selection:  You will be prompted to browse to the folder location.  Click the bottom selection "Select Cur Dir" when ready.  It does NOT create a new folder as you must choose an existing one.
Must provide a folder location for every run of the vi.

B.  Path
This is where you enter the desired path name if you selected "Hardcoded FOlder".  It must be in the appropriate format and contain the FULL path.  Example:  C:\LV_Example\Here\Now


C.  Leading Filename:
It is the portion of the filename that leads any numeric value that gets incremented.  Anything in this box is treated as a string, therefore a filename such as MY123File456name789is.wow  can have a numeric value appended and incremented anywhere...  meaning if the leading filename is MY123File, then the next increment should be 457... although, it may not work because it actually expects an extention to follow the numeric value...  experiment at your own risk 😉

D.  Create Extention:
It is the string control that will append an extention to the filename if & only if there is NO extention to begin with.  It will NOT overwrite an existing extention.
The benefit of this is when you create either a new filename in an existing folder or a completely new folder, it will also append an extention.  It will also add the "." (period) if it is non-existant 😄

E. New Filename:
As the name of the indication suggests, it is the newly created filename.

F.  Others:
Common debug windows.  I'm too lazy to describe them.  They have no impact of this vi...  so I say...  hum...
okay...
Folder list contains the listing of all files within the selected folder.  It is used to parse and compare values within the vi.  Maybe I should remove it from the Front Panel.  Same thing with the file extention indicator... I wanted to echo the extention in case I miswired something.
Error In & Out... Your conventional clusters..


Have fun... Experiment with it.. And let me know how it went.  😄


Ray

Message 25 of 94
(2,375 Views)

Hi Ray,

Sorry for the delayed response, I've gotten sidetracked with a few other issues.  Thanks for reposting the vi for me.  As far as I can tell this is more or less what I need.  I'm working on my program and if I have any other problems I'll give you a post.

Thanks again for tkaing your time to hlep me out, I really appreciate it!

 

 

Using Labview 7.0 and 2010 SP1 with Windows XP and 7.
0 Kudos
Message 26 of 94
(2,368 Views)

You are welcomed Mah.

Happy Holidays..  and Best Wishes for the New Year.

I hope the vi works well for you.  It was fun modifying it  😄

Ray

Message 27 of 94
(2,364 Views)

Hiiii, Ray

                Thanks for the solution, it is nice and working good, thanks again,

                Enjoy the holidays and Happy Holidays and Enjoy urself, and also Best wishes to you for the New Year.

                Here are ur christmas gifts.

 

             

                 

Thanks,

Nishant

Message 28 of 94
(2,350 Views)

Thanks Nishant,

I'm glad it worked out well for you, too!

Have a Merry Christmas, Happy Holidays, Happy New Year, and so on..

I will open your gifts after midnight tomorrow.. 😉

Ray

😄

Message 29 of 94
(2,350 Views)

Hiii,Ray

     How are you? i am back for the help on this file write query, i think that you dont mind for it!!!!!

    I want to ask you that the file which we are creating through the wirte LVM has the big header that is what i dont want and anothe thing that i want is the header as i have shown in the excel sheet attached with this mail, so is there any possibility to remove such long header form the files which are written with the write lvm and i only want the header which i want, so how it is possible?

Thanks,

Nishant

Message 30 of 94
(2,290 Views)