The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Write To File

SercoSteveB
Active Participant

What is the status and content of C:\Users\Tester\Documents\temp.txt following execution of the VI?

Write To File.png

a) temp.txt exists but is empty

b) temp.txt does not exist

c) temp.txt exists and contains

SteveLikesLabVIEW

SteveLikesLabVIEW

SteveLikesLabVIEW

SteveLikesLabVIEW

d) temp.txt exits and contains:

SteveLikesLabVIEW

SteveLikesLabVIEW

SteveLikesLabVIEW

SteveLikesLabVIEW

Comments
DesasterMaster
NI Employee (retired)

C

--------------------------------------------------------------------------------------------------------
Work with NI Hard- and Software for about 15 years now.

Certified LabVIEW Developer & TestStand Developer/Architect

--------------------------------------------------------------------------------------------------------

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
nik35324
Member

C

crossrulz
Knight of NI

C


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
dhanalakshmi.ja
Member

c

shree_bala
Member

C

LordNobady
Member

C


Learning LabVIEW since January 2013
tst
Knight of NI Knight of NI
Knight of NI

I'm not very familiar with how the function treats the convert EOL option and how it behaves with the CRLF, but one important point to consider is that at least according to the documentation, the function will not create folders, so if the folder isn't there, option B should be the correct answer.

It's important to remember to create the folders where you save files - there's an OpenG function which does this, and in current versions of LV I believe the create folder function also manages the whole hierarchy natively, but I believe it also returns an error if the folder already exists, which the OpenG VI does not.


___________________
Try to take over the world!
crossrulz
Knight of NI

tst wrote:

I believe the create folder function also manages the whole hierarchy natively, but I believe it also returns an error if the folder already exists, which the OpenG VI does not.


                   

That is all correct.  The error the native function returns if the folder exists is 10: Duplicate File.


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
MrStevenUND
Member

C

Not applicable

B - If we assume the folder does not exist.

C - On the assumption the folder exists.

ramesh44
Member

i go with D because the array which created is 2*1 so i think evry time it write to filem is two lines

pksusic
Member

c

Jamey
Member

No because without the carriage return/linefeed you would get:

SteveLikesLabVIEWSteveLikesLabVIEWSteveLikesLabVIEWSteveLikesLabVIEW

with no new lines included.

Jamey
Member

It's not an array, it is a concactenate string.

ramesh44
Member

Thanks for the correction yes its Answer is C

ashwinilele
Member

C

eleshrudra
Member

answer is C

R.Elesh
SercoSteveB
Active Participant

Original Answer: C.  Answer after tst having given it the thought I should have:  B or C. 

Nicely explained above, thanks tst.

Seedorfan
Member

LabVIEW help:
"This function appends platform-dependent, end-of-line (EOL) characters to the elements of an array even if you right-click the function and remove the checkmark next to the Convert EOL shortcut menu item."


So what is that for?

But I've made interesting observation:


Przechwytywanie.JPG

littlett
Member

Hi,

 

Can anyone explain what's the difference between "Convert EOL" checked and unchecked?

 

Thanks,

crossrulz
Knight of NI

It is mostly used to multi-platform text files.  In Linux (like the newer cRIOs), the End Of Line (EOL) is a Line Feed (0x0A).  On Windows, the EOL is a Carriage Return and a Line Feed (0x0D0A).  So the option will help convert between the multiple types of EOLs.


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
levonsg
Member

C

https://images.youracclaim.com/size/340x340/images/2edb5b1a-9414-44e1-8519-c774fc6dd079/36015_Certificate_Badges_FINAL__1__NI_Instructor_v5.png
A.Bernau
Member

With Internet Explorer and Windows 10 I can not see any difference between answer c and d.
So I copied all answers to MS Notepad. Now I guess answer c is with 2 times CRLF between the text and answer d is wit 3 CRLF between the text. So finally not A, B, D. Remains c (as long we have the correct path)
Thanks crossrulz for the Explanation.

Al_Niz
Member

Hi, 

for those People  (like me) that dont see the differences between C & D am there is a Problem showing the empty lines betwen These String in D):

Empty_Line_Problem.PNG

Copy pasting it from Microsoft Edge into a txt File:

TextEditor.PNG

The funny Thing is when copying from goole Chrome there will be an empty line between all strings

Please correct me if am wrong.

cobbPP
Member

1. SteveLikesLabVIEW
2. SteveLikesLabVIEW
3. SteveLikesLabVIEW
4. SteveLikesLabVIEW

5. 

 

Seriously how is this an exam question... NI examiners need to test the competency of technical computing than string manipulation, I am a bit disappointed. Anyone could generate this in C or MATLAB without lifting a finger 😉  

crossrulz
Knight of NI

Yes, this is a stupid simple application.  That is not the point of this question.  This question is more about somebody's knowledge of the Write Text File function than anything.


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