12 Replies Latest reply on May 30, 2006 9:08 AM by PackinDaMAC

    CrLf &CFML

    PackinDaMAC Level 1
      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.....
        • 1. Re: CrLf &CFML
          jdeline Level 1
          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?
          • 2. Re: CrLf &CFML
            PackinDaMAC Level 1
            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#">
            • 3. Re: CrLf &amp;CFML
              Dan Bracuk Level 5
              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>

              • 4. Re: CrLf &amp;CFML
                jdeline Level 1
                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&ente rthread=y
                • 5. Re: CrLf &amp;CFML
                  PackinDaMAC Level 1
                  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.....
                  • 6. Re: CrLf &amp;CFML
                    jdeline Level 1
                    Web browsers have no concept of CR/LF. They do understand <BR> and <P>. So change your code to something like the following:

                    • 7. Re: CrLf &amp;CFML
                      PackinDaMAC Level 1
                      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?????
                      • 8. Re: CrLf &amp;CFML
                        SafariTECH Level 1
                        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.
                        • 9. Re: CrLf &amp;CFML
                          PackinDaMAC Level 1
                          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.......
                          • 10. CrLf &amp;CFML
                            SafariTECH Level 1
                            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)
                            • 11. CrLf &amp;CFML
                              PackinDaMAC Level 1
                              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....
                              • 12. Re: CrLf &amp;CFML
                                PackinDaMAC Level 1
                                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