Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
Dr. Goomba #1
replace carriage return with comma
i am using <cftextarea> to input numbers on each line. when i submit the form
it is outputting: 'number1 number2 number3'.
well i am trying to replace the space (which i thought would be a line break)
with a comma. however everything i try outputs the same way 'number1 number2
number3'.
#Replace(number,'#chr(32)#', ',', 'all')#
#Replace(number,'#chr(10)#', ',', 'all')#
#Replace(number,'#chr(13)#', ',', 'all')#
#Replace(number,' ', ',', 'all')#
Dr. Goomba Guest
-
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... -
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... -
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,... -
Dan Bracuk #2
Re: replace carriage return with comma
replace(number, " ", ",", "all")
Dan Bracuk Guest
-
mxstu #3
Re: replace carriage return with comma
If there is a literal space [ chr(32) ] in between the values "number1 number2
number3", then either of these should work
#Replace(number, chr(32), ',', 'all')#
#Replace(number,' ', ',', 'all')#
However, if you need a sanity check, you can easily determine exactly what the
character values are, by removing all of the letters and numbers from the form
field and outputting the ascii values of the remaining characters (ie.
delimiters between 'number1', 'number2' and 'number3')
<!--- remove all numbers and letters from form field value --->
<cfset parsedValue = reReplaceNoCase(form.number, "[a-z,A-Z,0-9]", "", "all")>
<!--- show ascii value of remaining characters --->
<cfloop from="1" to="#len(parsedValue)#" index="i">
<cfoutput>
asc value of position[#i#] = #asc(mid(parsedValue, i, 1))#<br>
</cfoutput>
</cfloop>
mxstu Guest



Reply With Quote

