Add new line to end of text file

5 posts by 2 authors in: Forums > CMS Builder
Last Post: June 15, 2010   (RSS)

Re: [eduran582] Add new line to end of text file

By Jason - June 14, 2010

Hi,

What is being outputted to the text file? Do the variables output correctly, just not the blank line at the end?

If you could attach the .php file you're using and a copy of the text file it produces, I can take a closer look.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Add new line to end of text file

By eduran582 - June 14, 2010

Hi Jason,

Thanks for responding. Because of the confidential information included in the file the written to, how about I email both to you. Would your email be jason@interactivetools.com? [cool]

Eric

Re: [eduran582] Add new line to end of text file

By Jason - June 15, 2010

Hi Eric,

Not a problem, email them to jason@interactivetools.com and I'll take a look.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [eduran582] Add new line to end of text file

By Jason - June 15, 2010

It seems that you create 2 strings. One called $tData on line 105 (this has \r\n at the beginning and the end of the string) and one called $Data on line 121 (this doesn't have \r\n). $tData only seems to be used to make a comparison checking to make sure the same line isn't being outputted twice. $tData is never actually outputted to the file, only $Data is. What I would suggest trying is adding \r\n to the end of $Data since this is the variable that's written to the file. Also, I would only put it at the end. If you put it at the beginning and the end, you'll be putting a blank line before and after the line you're writing (if this is what you want, then put it before and after).

I hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/