LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Wolfgang

rename file in project tree

Status: New

Hello,

whereas it is possible to add, remove and rename a folder in the project tree via a right-click popup menu it is unfortunately not possible to rename a file.

Instead one has to remove the file (plus its accompanying include file) from the project, rename it in Windows File Explorer, and then add it to the project again.

It would be more convenient being able to do so within the project tree, similar to the ability to rename folders.

5 Comments
Constantin--P
NI Employee (retired)

Hello Wolfgang,

 

In the mean time you can do File->Save As... and the file will also be changed in the project tree. It's not exactly what you asked but it's easier than removing the file and re-adding to the project.

Wolfgang
Trusted Enthusiast

Hey Constantin,

 

Thanks a lot for looking into it! Unfortunately I have to admit that I did not get your suggestion....Smiley Embarassed

 

In my case a project (say A) consists of several source code files (say A_a, A_b, A_c, Ad...), include files,... and I want to rename one in this list (say from Ad to A_d). The File menu which you are referring to provides a File Save As for the project (A.prj), but not for individual files. I did not want to rename the whole project, just one file within (e.g. to better comply with a certain naming scheme).

Constantin--P
NI Employee (retired)

Hello, I'm sorry for not being clear. You have to open Ad.c and Save As...  this file.

RobertoBozzolo
Proven Zealot

Constantin this is what I currently do, but it is to say that this leaves the old file while it creates a new one with the stated name. A direct rename in File Explorer fashion will avoid having to delete the "renamed" files afterwards.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
MarcelK
Member

My workaround:

Right click the file, select "Replace File in Project", then hit "Browse..." and rename the file within the File Selection box that is now open as you would in Explorer. Double click the renamed file to replace the original file in the project.

Not too pretty but workable.