How do I replace a file using Write Characters to file.vi 
Author Message
 How do I replace a file using Write Characters to file.vi

I want to replace a file of strings without being prompted about being
asked to relpace it.


Sat, 17 Jan 2004 18:31:17 GMT  
 How do I replace a file using Write Characters to file.vi
If you don't want to be prompted as to which file, then you will have
to wire in the exact file path.  On the block diagram, rt-click on the
file path input of this VI and select create constant.  In the
constant path box, enter the path and name of the file (e.g.
C:\programs\text.txt).
This VI also gives you the option to append to file or overwrite by
wiring a T or F (F for replacing) to its append to file input.

Good luck, Doug



Sat, 17 Jan 2004 19:04:29 GMT  
 How do I replace a file using Write Characters to file.vi
1) Check if file already exists and delete if yes
2) Save the new one

If you need more security you could also

1) Check if file already exists and rename (eg. change extension to
bak) if yes
2) Save the new one
3) a) no problem in 2): delete the .bak
   b) problem in 2): rename .bak to its original name

You will need to use the intermediate and advanced file functions to
do that.



Sun, 18 Jan 2004 14:59:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to replace or create a file using the open/create/replace.vi

2. main's open/replace/create file.vi but write in subvi

3. Behavior of newline character in ANS Forth, using WRITE-FILE

4. Write to 2 file from pipe without using temp file

5. how to use Open/Create/Replace File.vi

6. How to replace characters in a text file

7. Replacing characters in ASCII file

8. Replace characters in file

9. Replace high-bit characters in file.

10. in-file search/replace question without using mv or cp

11. Replace pattern in file with another file?

12. Write File.vi does not allow for offset entry

 

 
Powered by phpBB® Forum Software