• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CrLf &CFML

Participant ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

I have this code and it outputs these values of data that i have to a text file all in one long line.....I wanted to know where do i put the CrLF in Coldfusion to begin a new line....or what string values should i pass the REReplaceNoCase()???? I just want to begin a new line after one section of data.....
TOPICS
Advanced techniques

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , May 30, 2006 May 30, 2006
I added a counter varible and created the values in the names of all my controls so they would all have thier individual names and then i loop through only the mcall#i# that were defined and then wrote them to the file in a string......Thanks for the help

Votes

Translate

Translate
Guest
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

Well, the code you provided only produces a checkbox with no text next to it. Are you refering to the action page where the value of mcall is the long string of data set as a value?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

when i am writing to the file and i look at my file all my data that i write to it is in one long line...I am writing those values of mcall to a file...but when i look at the file all the data is in one line........where do i add my CrLf so i can start a new line??

<cffile action="write" file="D:\PhoneReminder\msg.txt" addnewline="yes" output="#mcall#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

quote:

Originally posted by: PackinDaMAC
when i am writing to the file and i look at my file all my data that i write to it is in one long line...I am writing those values of mcall to a file...but when i look at the file all the data is in one line........where do i add my CrLf so i can start a new line??

<cffile action="write" file="D:\PhoneReminder\msg.txt" addnewline="yes" output="#mcall#">

This is how I send query results to a text file:
<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#...etc...#chr(13)#">
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

If you display your text in a table cell whose width is constrained, you can get the word wrap you want. Refer to this thread for more information http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=2&threadid=1157252&enterthread=y

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

That did not change my results to the file when i changed the table data to the width of 300px............I have this data

datadatadatadatadatadatadata I want it to look like

data
data
data
data
data

U cant just do something like <cfset crlf = CHR(10) & CHR(13)> and use the varible like

<input type = "checkbox" value"#data##crlf# #data# #crlf# #data#>???? is that not the correct way to do this.....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

Web browsers have no concept of CR/LF. They do understand <BR> and <P>. So change your code to something like the following:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

When i used <P> all is did was show the string value <P>.....I get an error when dont add the quotes........and the same thing goes for <br> is there a certain way i need to add it?????

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

He's writing to a TXT file, so the <P> nor <BR> tags will do anything, he has to create a linefeed.

This problem is inter-related with another we started working on yesterday, which is why the general understanding of the problem has been lost.

It would help PackinDaMAC, if you kept everything related to the entire project in one thread

I answered you in your other post closer to the top about the same thing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 26, 2006 May 26, 2006

Copy link to clipboard

Copied

Yea i know...it just seems that if you keep things in one thread too long no one answers anymore....thanks for the info though......

I have two issues my textbox's if i change the dynamic infomation in them they do not change in the textfile..is that due to the fact the all the txtboxes have the same name ("pname")...????

.my 2nd issue is that when i use the #chr(10)chr(13)# it returns a new line but it leaves a comma at the begining of each line.......

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 27, 2006 May 27, 2006

Copy link to clipboard

Copied

I know what is happening here (text fields) but I have a full weekend. I will be back here next week to help you with this and have added it to my subscribed list so I can find it easily when I get back.

In short, because you are putting all the data in the checkboxes to use as what you write, the text fields will not update that data unless the form refreshes.

I can help you with this when I get back if you don't figure it out before then.

( and you alreayd figured out the linefeed comma thing)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 28, 2006 May 28, 2006

Copy link to clipboard

Copied

Thanks I will be trying to figure it out over this long weekend....but please come back to help....thanks a bunch!! but i was thinking that maybe i had to give a name to all my <tr> so that i can refer to them individually....like using a <cfloop>??? not to sure though....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 30, 2006 May 30, 2006

Copy link to clipboard

Copied

LATEST
I added a counter varible and created the values in the names of all my controls so they would all have thier individual names and then i loop through only the mcall#i# that were defined and then wrote them to the file in a string......Thanks for the help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation