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

Similar Messages

  • 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

  • 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

  • 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

  • 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 remove carriage returns in message mapping

    Hi Experts,
    I am getting carriage returns in one of the source field, i need to remove those carriage returns and i need to pass it to target field, can anyone suggest me how can i achieve this.

    Hello,
    Are you getting only CR or CR+LF (line feed) ?
    In this case - CRLF - you can use content conversion in your sender adapter:
    <recordset_structure>.fieldSeparator = 'nl'
    So in your receiver adapter you can replace any special char by 'nl' again.
    Check these links.
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
    Regards,
    Diego Estanguini Gabriel

  • How to retain carriage return and spaces in a report..

    Hi everyone,
    I have a TEXT AREA where users enter comments in that like
    First record
    Hi           Carriage returns          spaces
    Second  record
    Hi
    carriage returns
    spaces
    Third record
    Hi
         carriage returns
                                 spaces
    Is it possible to retain the carriage returns and spaces when i am displaying the records in a report.
    For carriage returns i replaced  chr(10) with '
    (without the single quotes). I works fine. But how i can i retain the spacesplease give me some suggestions
    Thanks
    phani

    Hi dimitri,
    Thanks for the reply
    For carriage returns i am doing like this replace(column_name,chr(10),'<"br">') (Ignore the double quotes)
    For spaces is there any ASCII code like chr(10) for carriage returns..
    I mean how to identify Number of spaces in database..
    Thanks
    phani
    Message was edited by:
    phani marella

  • 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)  

  • How to use carriage return in formcalc

    I'm sure the answer to this question is simple, but being new to formcalc (and scripting in general) I am having problems with it.
    The details:
    I have a dynamic form in livecycle. The two fields I am having problems with currently are a drop down list, and a text box (not field) associated with it. What is listed in the text box is dependant upon the choice from the dropdown list. So far everything is, functionally, working. I have the formcalc scripting event set to change on the dropdown list with the following script
    if (xfa.event.newText == "Office 1") then
         OfficeAddress1 = "123 Street Road #xD Town City, US 12121 #xD (111) 555-1414"
    endif
    "Office 1" being the dropdown selection
    OfficeAddress1 being the name of the text field
    The fake address being the address, seperated by carriage return symbols (#xD) to indicate where I want it to jump to the next line.
    The script is working fine except that the #xD symbols are showing up on the final form. How do I prevent this?
    Thanks for you assistance.

    Thanks Paul, good advice.
    For anyone that would want to do this in formcalc, the embarrassingly simple way of using a carriage return in the script is... hitting the enter button... no syntax required.
    Don't bother trying to line it up in the scripting screen (my mistake), that only puts more spaces than is necessary and will mess up the text orientation on the final form. Just hit enter and don't worry if it's not lined up, it will be.

  • How to supress carriage return in File?

    Hi
    I am getting a file which is very large. When i am processing the large file, file adapter is picking but i dont see any message in SXMB_MONI. Each record in my file should be in same line, But some of the fields like "address2" in the records have carriage return so when ever this address2 has data this record splits into two lines.
    Ex:
    Name, ID, Address1, Address2, City, State, Country..
    Name, ID, Address1, Address2, City, State, Country..
    Name, ID, Address1, Address2, City, State, Country..
    Name, ID, Address1,Address2,
    City, Country....* like this....
    think because of this my file is not processing. Because I checked individually this type of records I am getting the errors.
    But if i am processing as whole file XI is picking up but its not showing anything in SXMB_MONI.
    How to remove the carriage return if i get the records like this.
    Thanks & Regards
    Sowmya...

    Hi,
    Even if you have any errors in the file data, it should not stop XI from picking up the file. In this case, the file should be processed and you should find errors in SXMB_MONI. When you said compressed what did you do? Did you make a shorter file out of the large one? In that case, check if the file name and directory are exactly configured (case sensitive). Check the adapter monitoring if you find any red light.
    Coming to the data problem, unless you file end character is different from carriage return, I do not think XI would be able to parse the file properly. You might want to request you file generating application to suppress the carriage return in any of the data fields or at least the record delimiter.
    VJ

  • How to undo carriage returns?

    Hi, I send char(10) and char(13) to my output stream to move to the next line. If the user presses the backspace, char(8), I have to undo what he has typed. Undoing characters is not a problem as long as the user has not moved to the next line (no carriage return was sent to output stream).
    I would like my cursor to move back to previous line if user does backspace and current line has no more characters. Anyone knows how?
    Btw, sending char(8) to the outputstream did not do the trick, it only did so for charaters.
    Thanks.

    Well, it's still not working today (after 20 years). The application is on a DOS environment. Would like to undo previous line when user continuously presses backspace.

  • How to handle carriage return/linefeed embedded in text field as first char

    Hi,
    I am trying to use sqlldr to import text that is comma-separated and double quote-enclosed, but contains embedded carriage return/linefeed pairs. I have a control file which works for most cases and looks like this:
    LOAD DATA
    INFILE './foo.new'
    APPEND
    CONTINUEIF LAST PRESERVE (<>'"')
    INTO TABLE <tablename>
    FIELDS TERMINATED BY "," ENCLOSED BY '"'
    TRAILING NULLCOLS
    Unfortunately, this fails when the very first character of the text field is a carriage return/linefeed pair, e.g.,:
    "11","22","33","\r\nThis is the fourth field","","","","",""
    In that case, what is actually the opening double-quote for the fourth field, is interpreted by the CONTINUEIF clause as the end of that line. Can anyone please point me to a solution?
    thanks.
    stan.

    Thanks for the suggestion. Unfortunately, I've already tried it, and it doesn't help. I believe the problem is that sqlldr tries to figure out where each record is delimited before it parses out the field. So, any field-level trimming depends on sqlldr first determining that the cr/lf is actually part of that record, and not an indication of the start of a new record (and it's doing the latter right now). Fwiw, Python's csv parser will handle this type of record just fine.
    regards.
    stan.

  • How to capture carriage return in SAP Business One?

    Hi guys,
    I am using C# for developing a plug-in for SAP business one 2005, I tried to use '\n' to capture carriage return in some fields that are stored in SQL server 2005, but it didn't work. I tried the same code in a C# windows application and it worked. I just want to know that if the carriage return in SAP has a special sequence code for that or not.
    The code I tried is "
    string s = "something";
    if (s.contains('\n'))
       //do something;
    Thanks  a lot

    Hi,
    I guess you did a typo: Chr(9) is TAB... I think you meant Chr(10).
    Regards,
    Eric

  • 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

  • Plain HTTP Adapter - How to add CR/LF into Prolog?

    Hi all!
    I have to do a multipart/formdata request to an external HTTP Server. This requires to set boundaries etc. AND
    to add Carriage Returns / Line Feeds into the HTTP-Body.
    I think I could solve the problem using the Prolog / Epilog functionality of the HTTP Plain adapter - the only
    thing that is missing now is <b>how to add Carriage Returns / Line Feeds into the Prolog / Epilog Field</b> within the communication channel configuration. It seems
    that there is no "escaping possibility" - the HTTP Adapter writes the prolog "as it is entered" into the htto-Body of the request.
    Any ideas?
    Many thanks in advance,
    Andy

    I recommend using Java Mapping.
    Stefan

Maybe you are looking for

  • Put photos in the wrong desitnation

    I imported photos and forgot to update the last desitnation to the new one I created for the new photos. So, they got imported into the last folder I imported the previous set to. I want to move them to the proper folder, but I am afraid to use the "

  • How to Install PHP in PL/SQL??

    Hello!! How to install php in pl/sql ??

  • Implementing multiple tasks on one hardware

    Hi, i am anil, i am using NI CDAQ 9188 Chasis, for NI 9237 of 5 numbers, for load cells measurment, for my application i have requirement of acquiring reading from all channels simultaneously, and i need to scale them independently. while configuring

  • How can I choose powerful system for After Effect?

    Hi Would you please help me? I want to buy new system for working with After Effect CS3, I dont want to buy turnkey station, I want to build it myself. Is there any good web site that recommends system for After Effect in different prices?( for examp

  • Error stack size

    Hi, i have build a package framework which in exceptional situations uses an encapsulated raise_application_error method with the -add to error stack- option. In combination with -speaking- messages it seems as if i am now running against the error s