|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
CFFILE APPEND at the beginning
Author: CFDEV
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32904#165126
Thanks a lot,
I tought of that but I was sonwdering if there was something I missed in the
append attributes to facilitate the manipulation...
Thank you
Pat
_____
Sent: June 1, 2004 11:21
To: CF-Talk
Subject: RE: CFFILE APPEND at the beginning
<cfset crlf = chr(13) & chr(10)>
<cffile action="READ" file="#variables.file#" variable="out">
<cfset out = "my line here" & crlf & variables.out>
<cffile action="WRITE" file="#variables.file#" output="#variables.out#"
addnewline="No">
Of course, this requires reading the whole file. If you are on cfmx,
maybe this can be done in java?
Pascal
----- Excess quoted text cut - see Original Post for more -----
_____
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32904#165124
<cfset crlf = chr(13) & chr(10)>
<cffile action="READ" file="#variables.file#" variable="out">
<cfset out = "my line here" & crlf & variables.out>
<cffile action="WRITE" file="#variables.file#" output="#variables.out#"
addnewline="No">
Of course, this requires reading the whole file. If you are on cfmx,
maybe this can be done in java?
Pascal
----- Excess quoted text cut - see Original Post for more -----
Author: Katz, Dov B (IT)
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32904#165120
Prepending to a file involves reading and rewriting the file. CFFILE
read, and CFFILE write with #newstring# newline #existing file#
But if it's a one time thing, you might want to do this dynamically when
you output the file by outputting the "header" line before the file
content.
HTH
-dov
_____
Sent: Tuesday, June 01, 2004 11:11 AM
To: CF-Talk
Subject: CFFILE APPEND at the beginning
Hi all,
The cffile append function append a document at the end..how could I
insert
a line at the beginning instead?
Thanks
Pat
_____
Author: CFDEV
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32904#165119
Hi all,
The cffile append function append a document at the end..how could I insert
a line at the beginning instead?
Thanks
Pat
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||