9 Replies Latest reply: May 15, 2014 9:51 AM by Bob Yarnall RSS

    Preserve CR LF on export

    RicG _

      Does anyone know if its possible to preserve the CR LF in table view when exporting to a csv file as I seem to be losing them on export? Copying the text from a table view field directly into a hex editor shows 0D 0A (CR LF) but viewing the exported file in the same way they are no longer there. (Monarch 7 Pro)

       

      Thanks.

        • Preserve CR LF on export
          Nick Osdale-Popa

          I'm curious as to why you need to preserve the CRLF in a csv file.  If they were preserved, wherever the CRLF was you'd get a new line and thus losing the continuity of a csv file.

           

          If you need parse a csv file for CRLF for other processing, then I would just append a string, such as "

          ", where the CRLF should be at.  Then you can parse for those characters and insert your CRLF.

           

          Does that make sense?

          • Preserve CR LF on export
            RicG _

            The cell in the table view is a set of Notes which has some formatting from when it was imported in a dbf file. The original formatting has line breaks and I want to keep these when exporting.

             

            I see what you are saying though. Is there a way of searching a a table field in Monarch for a CRLF and replacing it with as you say a '

            ' ?

             

            Ohh and the field is of memo type and at most 15000 characters.

             

            [size="1"][ September 03, 2004, 05:08 AM: Message edited by: RicG ][/size]

            • Preserve CR LF on export
              rvelez

              Try using the utility MSRP.  Check it out:

              [url="http://www.datawatch.com/vortexmlsupport/downloads.asp"]http://www.datawatch.com/vortexmlsupport/downloads.asp[/url]

               

              You can find and replace the 0D 0A with "/n" prior to bring it into Monarch.  This way it will not disappear when you export it.  I did something like this from a report output.  I also used this to find and replace the "/n" back to 0D 0A after I exported from Monarch.  This way the report have the approriate CR and Line feeds on the text file.

               

              Hope this helps.

              • Preserve CR LF on export
                RicG _

                Thanks for the suggestion. My search string for msrp is,

                 

                msrp "/13/10" "/47n" MEMO1.dbf MEMO1.dbf

                 

                But this does not seem to be finding any occurences to replace. Am I doing something obviously wrong ?

                 

                Thanks.

                 

                 

                Originally posted by RVelez:

                Try using the utility MSRP.  Check it out:

                [url="http://www.datawatch.com/vortexmlsupport/downloads.asp"]http://www.datawatch.com/vortexmlsupport/downloads.asp[/url]

                 

                You can find and replace the 0D 0A with "/n" prior to bring it into Monarch.  This way it will not disappear when you export it.  I did something like this from a report output.  I also used this to find and replace the "/n" back to 0D 0A after I exported from Monarch.  This way the report have the approriate CR and Line feeds on the text file.

                 

                Hope this helps. /b[/quote]

                • Preserve CR LF on export
                  rvelez

                  you can't mix ascii with text.  so your replace string should be "/47/110" instead of "/47n"

                   

                  Hope this helps

                  Ruben

                  • Preserve CR LF on export
                    RicG _

                    Unfortunately this still doesn't find any occurences to replace  . This may be because the text in the dbf file is in hex ?

                     

                    Ahh well, thanks for all you help anyway  smile.gif[/img] .

                     

                    Originally posted by RVelez:

                    you can't mix ascii with text.  so your replace string should be "/47/110" instead of "/47n"

                     

                    Hope this helps

                    Ruben /b[/quote]

                    • Preserve CR LF on export
                      Grant Perkins

                      Richard,

                       

                      I note your original MSRP command line writes back to the same file ... are you sure you want to do that? Was that just a typo on the post?

                       

                      Also try running the Examine utility (Download from DW site if you have not already done so) to analyse what characters are in the file. It will do CRLF matched/not matched analyis as well.

                       

                      Might provide some clues.

                       

                      Grant

                       

                       

                      Originally posted by RicG:

                      Unfortunately this still doesn't find any occurences to replace     . This may be because the text in the dbf file is in hex ?

                       

                      Ahh well, thanks for all you help anyway   smile.gif[/img]  .

                       

                        /size[quote]quote:[/size]Originally posted by RVelez:

                      you can't mix ascii with text.  so your replace string should be "/47/110" instead of "/47n"

                       

                      Hope this helps

                      Ruben /b[/quote][/b][/size][/QUOTE]

                      • Preserve CR LF on export
                        RicG _

                        Thanks for the tip Grant.

                         

                        Interesting, using the examine tool on the dbf file there aren't as many CRLF as you'd expect yet Monarch somehow manages to know where they are (just wont export them)   :confused:  .

                         

                        By the way the names of the files are the same but i took a copy of the dbf file so wouldn't effect the original  smile.gif[/img] .

                        • Preserve CR LF on export
                          Bob Yarnall

                          Have you tried looking at your dbf file with your hex editor to see what is really there?  Perhaps Monarch is simply interpreting a new line presenting it to you that way.

                          The problem I see in maintaining the CRLF in a csv file is that when you open it with another program, it will assume that the CRLF is the end of the record and your data will be totally mixed up because it will try to interpret your break in the comment as the beginning of a new record.