Write to spreadsheet adds carriage return

I am using build array function to put together a number of strings and build an array of strings.  The build array is in a while loop.  A new line is added to the array every loop.  I am using write to spread sheet function to save the spreadsheet to a file with xls extension.  For some reason, a carriage return is inserted within the array.  The array has 9 columns and a carriage return is put after the fourth column.  I have not added this carriage return.  Does anyone know why write to spreadsheet might automatically add a carriage return and how to remove it?  
Thank you!
Solved!
Go to Solution.

Hi,
I took your posted VI and compiled it to an exe.  I do not see the carriage return problem you are describing?
If you compile the VI you attached, do you see the problem or is it only in the original main application (that you cannot share)?
If the compiled exe works on your PC, does it also work on the 'different' computer where you see the issue with your original code?  
-If it does work, then the issue must be in the source code for your original code.  Sometimes, if you re-size string constants, for example, it can be hard to see carriage return's.
Another thing it could be perhaps, is if you are calling the "write spreadsheet" in two different places in your main code, then the way it works is it will write your two (different) input arrays to separate lines.  If it is as in your example VI though, there should be no carriage return in the "middle" of the array.
For debug purposes, you could consider making a VI that takes a 1D string array input, iterates over each element in the array and searches for the carriage return character and gives an error/message on what iteration it found it, then you can back-track from there to see in the code responsible for making the string that went into that index.
QFang
CLD LabVIEW 7.1 to 2013

Similar Messages

  • Add carriage return in XML file

    Hi,
    I found a topic that correspond to my requirement :
    [Add carriage return in XML file|https://wiki.sdn.sap.com/wiki/display/XI/HowtoappendCarriageReturnintheendofeachtagofxml+file]
    But i don't know where created this udf, which input parameter pass?
    Thank you for your help.

    Hi Frantzy,
    The link does not give enough explanation. What I am assuming is if you have xml string in one field then if you need to add new line after each tag then you can follow that.
    If you want a udf where you want to insert a new line use this udf:
    Create a Value UDF with one input argument 'a' and name the udf as addnewline. Then add this code:
    Imports: java.*;
    String lines;
    lines = "";
    lines = lines.concat(a + '\n' );
    return lines;
    Then where ever you want a new line just add this udf in your mapping. If you want a new line for 10 fields then you can put in all the 10 fields.
    Example:
    Source field --> logic --> udf (addnewline) --> target.
    So after logic if you have the value as 123 then in the target you will see 123 followed by a carriage return.
    Regards,
    ---Satish

  • Address Book Adds Carriage Return to Street Field on Import

    I've been having some fun and games trying to import a large list of addresses in a tab delimited file into the Address Book. After finally managing to sort out all the issues with importing the file, I have now discovered that the value for the Street in all of the imported addresses has a carriage return (\r) character appended to them. There was not a carriage return present in the tab delimited file.
    I doublechecked the Address Book entries using Applescript to inspect the final character of the Street field and it was indeed a carriage return.
    I presume that this is due to the mapping of fields in the Address Book to the columns in my file. The Address Book allows you to enter 2 values for the Street, yet I am only using the first one with the second one being set to be ignored.
    However, the import still adds the carriage return character despite the second Street field not being required. It's not obvious that this is happening when viewing entries in the Address Book, yet when it comes to printing the imported addresses onto labels, a blank line is left due to the empty second Street field.
    If I edit the card and amend the Street field to, say, add a comma to the end of the Street or, take it away, the problem disappears. I don't want to manually edit all the imported address of which I have 275. Is there a workaround for this, or some Applescript that will automatically edit all the Street entries to remove the carriage return?
    Is anyone else experiencing this? Could this be classified as a bug?
    Before someone suggests I use the thirdparty Address Book Importer, I have tried that too and it also results in the same problem.
    Stuart
    Mac mini   Mac OS X (10.4.6)  

    The blank line appears when looking at the addresses through applications like SOHO Labels and Envelopes or Imprint. The problem is that the carriage return is added by the Address Book as it is being imported, rather than the carriage return being there already, so loading the tab delimited file into a spreadsheet will not show any carriage return characters.
    In the end I cooked up some Applescript to go through the Address Book and strip out any trailing carriage returns from the Street field for all addresses. I'm no Applescript guru, but the following seemed to do the trick:
    tell application "Address Book"
    set thePeople to every person
    repeat with thePerson in thePeople
    set theAddresses to every address of thePerson
    repeat with theAddress in theAddresses
    set streetinfo to street of theAddress
    if streetinfo ends with "\r" then
    set streetinfo2 to (text of characters 1 thru -2 of (streetinfo as string) as string)
    set street of theAddress to streetinfo2
    end if
    end repeat
    end repeat
    save addressbook
    end tell
    The other alternative was to write a script to parse my file in something like Ruby and then use Applescript to add the records rather than use the Address Book import feature. That would probably have given me some flexibility with being able to add multi-line notes, but the above was quicker to hack together.
    Stuart
    Mac mini (PPC)   Mac OS X (10.4.6)  

  • Converting Frame files to PDF adds carriage return in code snippets

    Our writing group is using FrameMaker 7.2 with Acrobat 9. The documentation we write includes code snippets. Conversion from Frame to PDF adds a carriage return to the end of any line of code. This causes any snippet containing a wrapped line to be incorrect if it is copied and pasted directly from the PDF.  Does anyone knopw if there's a fix for this?
    Thanks,
    George

    Dear Alexander,
    Thanks for the reply.
    In this I am using the FM 'CONVERT_ABAPSPOOLJOB_2_PDF'. I have checked the settings from SPAD that is also same in both servers for particular output device. But the patches are diffrennt in both the servers, the server from which layout is not coming properly having the high level patches in compare to the other server(which is working fine).

  • How to add carriage returns

    Greetings all
    I often download lyrics to songs and often they copy into MS Word without hard carriage returns-so they look as one huge paragraph.
    I think the solution is that I must first find out what escape characters are in there, then search and replace with maybe 0A, 0D hex, or something like this.
    Can you tell me first, how to view the actual characters in Terminal or any other program, then how to search and replace.
    can this be done in Text Edit, or Ms Word?
    Thanks much.

    Check out the thread at
    http://hints.macworld.com/article.php?story=20031018164326986
    Or: from http://sed.sourceforge.net/sed1line.txt :
    Using the Unix stream editor sed (type man sed in Terminal for usage):
    # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format.
    sed 's/.$//' # assumes that all lines end with CR/LF
    sed 's/^M$//' # in bash/tcsh, press Ctrl-V then Ctrl-M
    sed 's/\x0D$//' # works on ssed, gsed 3.02.80 or higher
    # IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format.
    sed "s/$/`echo -e \\\r`/" # command line under ksh
    sed 's/$'"/`echo \\\r`/" # command line under bash
    sed "s/$/`echo \\\r`/" # command line under zsh
    sed 's/$/\r/' # gsed 3.02.80 or higher
    # IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format.
    sed "s/$//" # method 1
    sed -n p # method 2
    # IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format.
    # Can only be done with UnxUtils sed, version 4.0.7 or higher. The
    # UnxUtils version can be identified by the custom "--text" switch
    # which appears when you use the "--help" switch. Otherwise, changing
    # DOS newlines to Unix newlines cannot be done with sed in a DOS
    # environment. Use "tr" instead.
    sed "s/\r//" infile >outfile # UnxUtils sed v4.0.7 or higher
    tr -d \r <infile >outfile # GNU tr version 1.22 or higher

  • How to Add Carriage Return After PageBreak using XSL code?

    Hi,
    I have created one RTF Template for Check printing. My requirement is to print check on next page if total number of invoices exceeds certain value.
    I achieved this and used below condition in my RTF Template.
    <xsl:if xdofo:ctx="inblock" test="count($invLines)>=$lpp"><xsl:attribute name="break-after">page</xsl:attribute></xsl:if>
    "lpp" is global variable whose value is set at the start of template. Now i also want to add some space after pagebreak in my Template.
    Like presently, check prints at the top of page, so i want to print it after leaving 9-10 lines blank.
    Can anyone please help me to achieve this?
    Thanks
    Amit

    Hi,
    I tried below syntax but its working only for first page, its not giving space for second page
    <xsl:if xdofo:ctx="inblock" test="count($invLines)>$lpp"><xsl:attribute name='space-after'>700pt</xsl:attribute></xsl:if>
    I want to combine it with page-break. Like i need specific space only after page break. I tried to combine both, but its not working. Any inputs on these?
    <xsl:if xdofo:ctx="inblock" test="count($invLines)>$lpp"><xsl:attribute name='space-after'>100pt</xsl:attribute>
    <xsl:attribute name="break-after">page</xsl:attribute></xsl:if>
    Thanks
    Amit
    Edited by: user11982820 on Apr 14, 2010 5:52 AM

  • Plain Text Control in Form - Add carriage return in text

    Hi, I'm trying to output a carriage in a Plain Text Control.  I've tried several combinations like CHR('13'), but can't get it to work.   Anyone know how to do this?
    Thanks,
    Ken Murray

    Hi Kenneth,
    did you try "\n" ? Like:
    "Entering a \n new line"
    HTH,
    Carsten

  • Need to add a carriage return in Paragraph styles

    Hi. I am in a muddle. I have a large amount of data from an xml source. I need to quickly add carriage returns appropriately throughout it so that the paragraph styles can be differentiated.I am using tags manually mapped to styles to do this.
    In order to carriage returns am I right in thinking that I can add a GREP style to each para style, and that it will sense the end of the para through the end marker position of each tag? If this is so, what would the GREP expressionlook like to that I can automate locating the end of a tag/para style so that I can add ~b to it?
    Gratefully!

    Hi @chantal_diva arts,
    It seems to be difficult, because you have much more invinsible character than only the xml markers in your document.
    I think one good way could be @obi-wan Kenobis way.
    Perhaps you can upload an example idml on a file hoster of your choise (e.g. xup.in).
    Regardless, you can try the following:
    1. text search:
    <FEFF>
    replace with:
    2. grep search:
    (?<=\b##)(.)
    replace with:
    \r$1
    3. clean document
    grep search:
    #+
    replace with:
    (nothing)  an empty replace field
    Have fun

  • Cl_gui_frontend_services= gui_download without carriage return

    Hi,
    Is there a way to get download a file to PC that way, that in the end of every lines there is a carriege return character except the last one? (Special format required by az external bank application)
    I tried to add carriage return to every lines, except the last one and use cl_gui_frontend_services=>gui_download.
    Although the "write_lf" parameter is set to space, the # is still inserted in the end of the last lines.
    Any suggestion, idea?
    Thanks in advance,
    Peter

    Hi
    When second time you call method just add the following
    CALL METHOD cl_gui_frontend_services=>gui_download
         EXPORTING
           filename                  = v_value
           append                    = 'X'        <------- Just add this line

  • Carriage return... mail

    Hi,
    I did a function to send mail but I want to know how to include a carriage return.
    My code is
    public boolean fxSendMail(String msgFrom,String msgTo, String cc,String msgSubject, String msgText)
              String host     = "mail.pils.com";
              boolean debug = true;
              // create some properties and get the default Session
              Properties props = new Properties();
              props.put("mail.smtp.host", host);
              Session session2 = Session.getDefaultInstance(props, null);     
              session2.setDebug(debug);                                                  
              try
                   // create a message
                   Message msg = new MimeMessage(session2);
                   //CC mail     
                   msg.setRecipient(Message.RecipientType.CC, new InternetAddress(cc));
                   //TO
                   msg.setFrom(new InternetAddress(msgFrom));
                   InternetAddress[] address = {new InternetAddress(msgTo)};               
                   msg.setRecipients(Message.RecipientType.TO, address);
                   //DATE
                   msg.setSentDate(new Date());
                   //SUBJECT
                   msg.setSubject(msgSubject);
                   // If the desired charset is known, you can use
                   // setText(text, charset)
                   //TEXT
                   msg.setText(msgText);
                   //send mail
                   Transport.send(msg);
              catch (MessagingException mex)
                   System.out.println("\n--Exception handling in email.jsp");
                   mex.printStackTrace();
                   System.out.println();
                   Exception ex = mex;
                   do
                        if (ex instanceof SendFailedException)
                             SendFailedException sfex = (SendFailedException)ex;
                             Address[] invalid = sfex.getInvalidAddresses();
                             if (invalid != null)
                                  System.out.println(" ** Invalid Addresses");
                                  if (invalid != null)
                                       for (int i = 0; i < invalid.length; i++)
                                       System.out.println(" " + invalid);
                             Address[] validUnsent = sfex.getValidUnsentAddresses();
                             if (validUnsent != null)
                                  System.out.println(" ** ValidUnsent Addresses");
                                  if (validUnsent != null)
                                       for (int i = 0; i < validUnsent.length; i++)
                                       System.out.println(" "+validUnsent[i]);
                             Address[] validSent = sfex.getValidSentAddresses();
                             if (validSent != null)
                                  System.out.println(" ** ValidSent Addresses");
                                  if (validSent != null)
                                       for (int i = 0; i < validSent.length; i++)
                                       System.out.println(" "+validSent[i]);
                        System.out.println();
                        if (ex instanceof MessagingException)
                             ex = ((MessagingException)ex).getNextException();
                        else
                             ex = null;
                   }while (ex != null);
              return true;
    } //end function
    %>
    but in my msgText I want to add carriage return manually
    example: msgText = "Project 123" + "carriage return" + "Form number 12"
    Thank you!
    Caroline

    I think you have to use:
    Carriage return : "\r"
    New Line: "\n"
    Either windows has to have both or unix has to have both (I don't remember). I think if you use "\n\r" you will be fine.
    Good Luck.
    Ylan.

  • Catching carriage returns in PL/SQL

         Raj Prathinidhi
         07/08/2004 10:51 AM
              To: Venkatesh Kalipi/Corp/Walgreens@Walgreens
              cc:
              Subject: OTN
    I need help to write code that accepts carriage return and converts
    it into a value.
    When I wrote something like
    set serveroutput on
    ACCEPT _value PROMPT 'Please enter a Number :'
    DECLARE
    your_value NUMBER(3);
    BEGIN
    IF NVL(&_value,'\n')='\n' THEN
    your_value:= -10;
    ELSIF &_value is not NULL THEN
    your_value := &p_number;
    ELSE
    your_value:= 0;
    END IF;
    exception
    WHEN OTHERS THEN
    your_value:= 0;
    This code gives an error when I hit "enter".
    Let me know if you have questions. Any help or hints are appreciated.
    Thanks.

    Thanks for the help. I am now able to recognize NULL and carriage return. However, when I enter a numeric, I can't parse it into a variable.
    set serveroutput on
    ACCEPT _value default chr(10) PROMPT 'Please enter a Number :'
    DECLARE
    store_number NUMBER(3);
    BEGIN
    dbms_output.put_line('Print after concat' || &_value );
         IF &_value =chr(10) THEN
                        dbms_output.put_line(Got CR');
         ELSIF &_value is NULL THEN
         dbms_output.put_line('Got Null');
         ELSE
              dbms_output.put_line('I am here');
                        store_number := to_number(&_value); //Doesn't work
         END IF;

  • How do i add a newline or carriage return to make my xml file look pretty?

    Hi guys
    I'm writing an xml file with jsp, the problem is, it writes it in one big chunk of text. e.g.
    <start>hello, my name is joe</start><middle>I like trees</middle><end>boo</end>
    Now what I want to do is present this xml file in a decent manner,
    e.g.
    <start>hello my name is joe</start>
    <middle>i like trees</middle>
    <end>boo</end>
    i've tried
    xmlFile = "<start>Hello my name is joe</start>"+\n\r;
    and
    xmlFile ="<start>Hello my name is joe</start>"+"\n\r";
    neither work, can anyone provide me with some insight into how I can add a carriage return / new line to make my xml file look pretty?
    Many thanks for any responses!

    u r right <BR> tag will not work...
    I wrote following code to generate xml file and it works fine...U can try the same...
    try
    FileOutputStream fos = new FileOutputStream("c:\\temp.xml");
    String xmlString = "<root>\n<start>Hello my name is joe</start>"+"\n";
    xmlString = xmlString +"<middle>blah blah</middle>\n</root>";
    fos.write(xmlString.getBytes());
    fos.close();
    fos = null;
    catch(Exception e)
    e.printStackTrace();
    }

  • How to add a carriage return

    Hi
    How to add a carriage return after Survey Type, so that the Channel Time will start from column one.
    Thanks,
    Steve
    Solved!
    Go to Solution.
    Attachments:
    Write.vi ‏39 KB

    try something like the following draft. (not tested, so modify as needed).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Write-MOD.vi ‏32 KB

  • How do I add a carriage return to the output ?

    I have a listBox with 15 values. That list box is connected to a textBox. The text box prints only the selected items from the listBox (thanks try67 for the help getting that set up). Now what I would like to do is have each of the items that are selected to appear seperately in lieu of having one lone continuous line. I think what I need to do is add a carriage returne (or two) between each item selected. Here is the code I have for custom calculation script
    var v = this.getField("DiagnosisList").value;
    if (typeof v=="string") event.value = v;
    else event.value = v.join(", ");
    I triend adding  /r/n   but I keep geting syntax error. Thanks for any assistane.

    I appreciate you assistance, but this is not going to work. The narrative on the listBox for each item is so large, that it either gets chopped off or if I set the text size to auto it is too small. Is there a way to display the list items in a format that 'wraps'? If not then I will neet to set it up with check boxes now, but here is how the format should work:
    () item one
    () item two
    () item three
    then allow certain ones to be checked,
    (x) itme one
    () item two
    (x) item three
    and based on the ones checked, those are the only ones that print
    Item one.
    Item two.

  • Add a carriage return in a Unbound String Field

    Post Author: Razzle00
    CA Forum: Formula
    Hi,
         How can I add a carriage return to an unbound string field in a crystal report.  I am using the bundled version of CR with MS Visual Studio 2003 & 2005.  My formula needs to look something like this....
    'Heading One:' + CARRIAGE RETURN + trim({tablename.fld_1}) + CARRIAGE RETURN + 'Heading Two:' + CARRIAGE RETURN  + trim({tablename.fld_2})
    this code all needs to be in 1 unbound string field.  Is this possible?
    Thanks,
    Razzle

    Post Author: SKodidine
    CA Forum: Formula
    To add a carriage return, add CHRW(13)
    For example:
    'Heading One:' & chrw(13) & 'sample text';
    will result in:
    Heading One:
    sample text

Maybe you are looking for