WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: Mykal on May 21, 2023, 11:15:44 PM

Title: Unwanted spaces between rows in a written file
Post by: Mykal on May 21, 2023, 11:15:44 PM
I'm a new Winbatch user.  When writing to a file I end up with each alternate row as a blank row.  I noted somewhere in the help files that something always adds an empty entry but I can't find it again.  How do I get rid of the blanks ???
Title: Re: Unwanted spaces between rows in a written file
Post by: kdmoyers on May 22, 2023, 04:47:27 AM
Welcome!

This is probably all about line-endings.  Lines can end with CR and LF, or just LF, and sometimes these get automatically added when you didn't expect that.

Can you post the few relevant lines of code from your program? 

Or even better, post a very short stand-alone script that demonstrates the problem?

This is the fastest and most reliable way to get help here on the forum.
Title: Re: Unwanted spaces between rows in a written file
Post by: JTaylor on May 22, 2023, 05:42:00 AM
Everything Kirby said plus, if you are using FileWrite() it adds a @CRLF automatically so make sure you aren't adding such things to the data you are writing.

Jim
Title: Re: Unwanted spaces between rows in a written file
Post by: Mykal on May 27, 2023, 05:57:34 PM
Thanks Guys.  I've fiddled round with it and seem to have overcome the problem, thanks to your help.  Cheers.