Ask a Question related to Coldfusion Database Access, Design and Development.
-
smnbin #1
Carriage Return Problem
Hello,
I have written some code which extracts data from a MySQL database and stores
it in a CSV file using CFFILE.
However, the database includes data inserted from an HTML textarea form
element which is stored in a MySQL text field. The textarea data includes
carriage returns which, when written to a CSV file, force a new line which
makes the data messy.
Is there a way of removing the carriage returns?
Many thanks,
Simon
smnbin Guest
-
Carriage Return
Please help me how I can enter text with carriage returns into my database. I have a Textbox with TextMode="MultiLine" Now, if inter a text... -
lingo carriage return
Hi, Is their a lingo command that can insert a carriage return at the end of a line in a text field. Thanks, Ben -
FTP doesn't add Carriage Return from VMS to NT?
When I try to use NET::FTP to transfer text files from VMS to NT (GET command using ASCII mode,) FTP will add the Linefeed, but not the required... -
return Carriage access 97
I have a zone list, in this i want to put a field with 250 Char, But in the form a can see only the width of the zone list, so my question is how... -
Carriage return in .ini files
Hi, I am using the FileIO xtra within my Director App to try and create an ini file that is being picked up by another application. However,... -
jdeline #2
Re: Carriage Return Problem
Use the Replace( ) function to get rid of your CR characters. Then place a CR at the end of each line before you write it as a CSV file.
<CFSET myText = Replace(myText, Chr(13), "", "ALL")>
jdeline Guest
-
smnbin #3
Re: Carriage Return Problem
jdeline,
Thank you for your response. However, I tried the following code, but a new
line is still being forced in the CSV file.
<cfset GetEndOfProgrammeEvaluationForms.c8 =
Replace(GetEndOfProgrammeEvaluationForms.c8,Chr(13 ),"","ALL")>
Any further ideas would be very much appreciated.
Simon
smnbin Guest
-
smnbin #4
Re: Carriage Return Problem
jdeline,
I tried the following, but it didn't work. I don't think my regular expression
is correct.
<cfset GetEndOfProgrammeEvaluationForms.c8 =
REReplace(GetEndOfProgrammeEvaluationForms.c8,"Chr (10)|Chr(13)","All")>
Any ideas?
Many thanks,
Simon
smnbin Guest
-
Dan Bracuk #5
Re: Carriage Return Problem
I recently had to deal with a similar situation. The differences are:
1. My file is pipe delimited.
2. My source data comes from a vendor application, not an html form.
The following code worked for me.
<cffile action="write" nameconflict="overwrite"
addnewline="no" output=""
file="d:\dw\dwweb\work\#CaseFileName#">
<cfoutput query="casedata">
<cffile action="append"
file="d:\dw\dwweb\work\#CaseFileName#"
output="#caseid#|strip a bunch of fields|#theatre_mcase#|#Replace(pre_op_diag,
chr(10), ' ', 'all')##chr(13)#">
</cfoutput>
Dan Bracuk Guest
-
MikerRoo #6
Re: Carriage Return Problem
You would use:
<cfset GetEndOfProgrammeEvaluationForms.c8 = REReplace (GetEndOfProgrammeEvaluationForms.c8, "", "", "All")>
MikerRoo Guest
-
smnbin #7
Re: Carriage Return Problem
MikerRoo - that has fixed the problem.
Thank you very much for your help.
smnbin
smnbin Guest



Reply With Quote

