1.

Solve : Append text at the end of a file?

Answer»

Hi All

I need to append the a string at the end of the file. The string should be in the last LINE. Assume a file contains the lastword as -Last. I need to add a string like New. Now when i append it is appending like -LastNew. But I need to append the string in the next line like
"Last
New"

Now if i use "echo." This will append like this
"Last

New"

A line BREAK is there in between the last line and the appended string. How can I do that with out a line break.

Thanks in advancehave you tried : echo line>>file.txt ?
C:\>type  anecho.bat
Quote

echo off
echo.  > file.txt

echo with a period provides a BLANK line  >>  file.txt

echo.  >> file.txt

echo see a blank line was inserted  >>  file.txt

Output :

C:\> anecho.bat

C:\>type file.txt

with a period provides a blank line

see a blank line was inserted

C:\>


Discussion

No Comment Found