Add new line to end of text file

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

By eduran582 - June 13, 2010 - edited: June 13, 2010

Hi all,
I'm having a problem adding a new line to the end of a text file that does not have a new line (and optionally adding a new blank line). Some of the variable values have quotes around them and some not.

Here's the line I want to add:
$Data = '"'.$oneVariable.'",'.$anotherVariable."\r\n"; //"oneThing",12345
I've tried using '"\r\n"'.$aVariable."\r\n" to create a new line first but that doesn't work either.

I know this is probably something simple but at this point, "I can't see the forest for the trees" and am getting lost.

TIA,
Eric

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/