From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why FileIO vi adds a blank row after editting?

Solved!
Go to solution

Hello

Hope everybody had a good christmas and looking forward to the new year.

I am stuck here thinking what have I done wrong this time. In my attached File IO, the application accesses and updates the .txt file called Account.txt which is also attached. It all works fine but after performing deposit and saving it using the enum values of the Control Command (control), if I open the Account.txt file, File IO vi seems to be working but unnecessarily adds a blank row which really annoys me. Please help!

(Account.txt file needs to be saved in C root directory)

Thx

Download All
0 Kudos
Message 1 of 2
(2,023 Views)
Solution
Accepted by topic author K.Waris

I have checked your VI.

problem Is whenever you are withdrawing or depositing you are converting string to array and vice versa

During this conversion hidden characters are getting added(carriage return)(\r\n). you can check the same by putting indicator to the string and making it display as in the mode '\' codes display by right clicking.

 

So while writing to file it is having one more carriage return and hence one row is added,

To get solution remove \r\n characters from string before writng it to array by using String functions.

(You can use search and replace string function to remove them).

 

I hope this will help

Message 2 of 2
(2,013 Views)