LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enter new line in text string in saved file when appear carriage return!

Hi, i have concatenated string and i want to saved the file, i use 'write characters to file', but its saved the bad way, when i open the file in windows the text appear with square where it would be the new line. I would like to know how can i remove the carriage return squares to the new line.

I attach pic:
1- Down, Like the file is saved.
2- Top,Like i would like it was writed.

Regards,jose.
0 Kudos
Message 1 of 13
(34,708 Views)
try using the end of line constant instead of the carriage return. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 13
(34,708 Views)
Yes, but i dont understand how make it, any example?

regards, Jose
0 Kudos
Message 3 of 13
(34,708 Views)
Look at this file. This will show you how to use it. It is located in the strings subpalette. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
Message 4 of 13
(34,708 Views)
you should use "\r\n" instead of just "\r" or "\n" alone on windows os.

-Joe
Message 5 of 13
(34,708 Views)
Hi Joe, thanks, I know i should to use \n and use ain vi to search the carriage return and put \n in this place, but i dont know how get it.

Any example?

Regards,jose.
0 Kudos
Message 6 of 13
(34,707 Views)
Thanks for your time, this way i knew, but the text is very long, for few lines is easy but the text is very high, i believe must to be other way more faster, with search replaicing or...

Regards,jose.
0 Kudos
Message 7 of 13
(34,708 Views)
Do you just want to view the file in windows? or you want to edit it so that all boxes become new lines?

For the first solution, you can search for a notepad replacement called "metapad", or you can using a vi to read the file and displayed in an indicator.

To edit it, the best way I think is to read the file in labview, search the string for "\r" or "\n" (you can find out which one is used in the string by righ-click on the string indicator, and choose " "\" code display ". Finally use the "search and replace string.vi" to replace it. See the attached images for example.

Joe
Download All
0 Kudos
Message 8 of 13
(34,708 Views)
Thanks Joe,
Edit it is the best, I got it, run good.
Regards,Jose.
0 Kudos
Message 9 of 13
(34,708 Views)
Look at the example, it might help you with your problem.

Chris
0 Kudos
Message 10 of 13
(34,708 Views)