Remove the last chr(13) & chr(10) from a string

Hello, all.
I'm trying to get confirmation files to upload to Amazon for their "Charge When Ship" program.  I've got the file creating as it should be with one minor exception.
I'm setting a variable, giving it the header column information and ending that with chr(13) & chr(10); then I'm looping through a query to add the information, each iteration tacks chr(13) & chr(10) to the end of it; then I'm taking that variable and writing the data to a file using CFFILE.
But I think that the last chr(13) & chr(10) is causing Amazon servers to think there's one more line of information than there really is, and it's erroring.
Can anyone tell me how to remove that last chr(13) & chr(10) from the variable before writing it to file?
Thanks,
^_^

giving it the header column information and ending that with chr(13) & chr(10); then I'm looping through a query to add the information, each iteration tacks chr(13) & chr(10) to the end of it; then I'm taking that variable and writing the data to a file using CFFILE.
Trim() the variable or change the code so it does not generate an extra new line.
Since your content has a header, place the new line characters at the beginining of each query iteration.
#headerColumnsHere#  <!--- notice there is no new line after the column header  information --->
<cfouput query="yourQuery">#chr(13)##chr(10)# #ColumnA##ColumnB#...etcetera...</cfoutput>

Similar Messages

  • Please help me remove the last elements of shell script from my applescript

    I read somewhere that running a shell script in an applescript was inefficient and created extra overhead, fine, so I am trying to take all of my shell script out of my applescript (this should fix issues with forward slashes in names as well...)
    however I am stuck on these last two lines (I know they are probably trivial but I've been up waaaay too long now) so I was wondering if anyone would be awesome enough to show me how to convert the bash to applescript.
    --does a recursive copy and rename
    do shell script "cp -R " & (thePath as text) & " " & (theOtherPathWithFile as text)
    --does a copy and rename, then a simple move
    do shell script "cp " & (quoted form of (POSIX path of this_item as text)) & " " & (theNewPath as text) & "&& mv " & (theOtherPathWithFile as text) & " ~/Desktop"
    Any and all help will be appreciated.

    There isn't anything wrong with using shell scripts, especially since AppleScript is designed to do this very thing. There is some overhead when using do shell script, just as there is some overhead when using an application tell statement, so it just depends on what you are doing.
    The performance of any particular script would also be up to whatever is acceptable to you (or your customers), and sometimes a shell script is the most efficient way to do something. Many of the system utilities are just GUI front-ends to a shell script, so they can't be all bad.
    To do your file copy or move with the Finder, you will need to tell it to duplicate or move the item(s) (there is that pesky overhead again). Shell scripts use POSIX paths while the Finder uses colons as its path delimiter, so you will need to use the correct file path references - there is a decent article about that at Satimage. Once your file paths have been defined (or using something like choose file or choose folder)), your script would be something like:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder"
    duplicate source to destination
    -- move source to destination
    end tell
    </pre>
    See the Finder and *System Events* scripting dictionaries for more information about the ways they deal with files.

  • How do I remove the last row in a csv data file

    I would like to remove the last row of data from a csv file that I have saved.  I can identify the start byte of the last row; however, I'm not sure what tool is the best one to remove it.  Should I move the EOF?  Should I open the file up to that point then save over the old one?  Is there another way I don't know about?  I am using labview 7.1.
    Thanks

    I would use the Read Text File.  You can right-click on it and tell it to read lines.  Then Delete From Array.  Leave the index and length unwired and it will delete the last item (I noticed your code is removing the second line).  Then open the file again set to replace or create and write your data.  This method allows you to propagate your errors instead of the Write/Read Spreadsheet File handling the errors for you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Remove last row of csv_BD.png ‏14 KB

  • Insert no#3 and remove the last 3 digits...

    Dear All,
    I would like to issue a voice translation-rule that can insert the digit number 3 before/after certain digits and also remove the last 3 digits at the same time.
    # Details:
    I receive the following Dialed numbers on a voice port for example: 004925147260123 For these numbers I have 3 sets:
    - Set 1: 004925147 is always the same; I need to insert the digit number 3 just after 004925, for my example 004925 --> must be 0049253
    - Set 2: consists of 3 digits can vary so I want the translation rule to translate these numbers to be the same numbers, for my example 260 --> must be 260
    - Set 3: The last 3 digits also they can vary but I would like to remove these last 3 digits from the final translated number
    So for my example I would like the voice translation-rule to translate the dialed no# 004925147260123 so that it will be 0049253147260
    Appreciate you support,
    Thanks..

    Thanks, the way i want it can be done like this:
    rule 1 /^\(004925\)\(......\)...$/ /\13\2/
    But you gave me the right way..
    Appreciate your support..
    Thanks.

  • Why does iMovie remove the last half of my imported clips?

    I've noticed that when I'm importing clips from an SD card the window tells me "___ minutes and ___ seconds have been imported from ___ clips." but when I go to view said footage, only the first half of the each clip is there. Literally to the second, iMovie stops at exactly the halfway point of the clip and just completely removes the last half. What's going on? Please help.

    I've noticed that when I'm importing clips from an SD card the window tells me "___ minutes and ___ seconds have been imported from ___ clips." but when I go to view said footage, only the first half of the each clip is there. Literally to the second, iMovie stops at exactly the halfway point of the clip and just completely removes the last half. What's going on? Please help.

  • I want to remove the COnlineBank, OnlineBank and csample applications from my application and web server.

    How can I safely do this on Solaris? I've tried "iasdeploy removeapp" and "iasdeploy removemodule" with no luck. I want to clear all of this demo stuff out to make both the web and app server look more production like.
    Thanks
    Eric

    Eric,
    these applications are applogics which are not controlled by the
    iasdeploy tool. Unfortunately, there is no tool available to remove
    these applications for you. What you can do is to manually remove all
    their entries, but be careful if you do that. If you remove the wrong
    keys you might break your ias installation, so be warned and make sure
    you backup the whole ias registry before attempting to remove anything.
    Eric Coleman wrote:
    >
    I want to remove the COnlineBank, OnlineBank and csample applications
    from my application and web server.
    How can I safely do this on Solaris? I've tried "iasdeploy removeapp"
    and "iasdeploy removemodule" with no luck. I want to clear all of
    this demo stuff out to make both the web and app server look more
    production like.
    Thanks
    Eric
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!--
    Han-Dat Luc ([email protected])
    Senior Consultant
    SUN Professional Services (iPlanet)
    o .
    o .
    O _ ____ _ _
    (_) _ \| | __ _ _ __ ___| |_ TM
    | | |_) | |/ _` | '_ \ / _ \ __|
    | | __/| | (_| | | | | __/ |_
    |_|_| |_|\__,_|_| |_|\___|\__|
    e-commerce solutions
    Sun Microsystems Australia Pty Ltd

  • How do I remove the previous owner's Apple ID from my 2nd hand iPhone, and replace it with my Apple ID?

    How do I remove the previous owner's Apple ID from my 2nd hand iPhone, and replace it with my Apple ID?

    settings - appstore - view id - log out and log in with your id.

  • I want to remove the header and footer when printing from my mac, i can do this in the Page Setup on my PC but not on the Mac. I can do it each time I print but then it resets. How do I make a universal change?

    I want to remove the header and footer when printing from my mac, I can do this in the Page Setup on my PC but not on the Mac. I can do it each time I print but then it resets. How do I make a universal change?
    == This happened ==
    Every time Firefox opened

    Go to the "File" menu, then "Print." The window that appears will have three drop-down menus at the top.
    The first is labeled "Printer",
    The second is "Presets".
    The third is unlabeled but has "Copies & Pages" selected by default.
    Click on that third menu and select "Firefox" near the bottom of the list.

  • How to remove the default members of a dimension from the control table?

    Hi all,
    I am new to hyperion FDM 11.1.1.2.0.0 .
    When I navigate to Metadata>Control Tables and try to delete the default memmbers
    for the dimension like category and period i got the following error.
    Error: Period( 8/31/2009 ) is an active Global or Local Period and cannot be deleted.
    Then again i unchecked active checkbox for that dimension from Hyperion Essbase Integration Setup of Workbench Client.
    After doing that i got the following error
    Error: Unable to retrieve target System Data.
    Can anyone tell me how to remove the default members of a dimension from the control table?
    Thanks

    Create a new record for the table.
    Go change the POV to the new record.
    Return to the control table and delete the default record.

  • HT1766 when i connect my iphone to pc the last stored ringtone get deleted from sound

    when i connect my iphone to pc the last stored ringtone get deleted from sound why so ??

    Non c'est normal: "appareils"= iPhone, iPod, iPad... Votre ordinateur est dans "Ordinateurs autorisés"

  • Table disabled after removing the last record

    After removing the last row of table and disables it is unable to select any record.
    Version: JDeveloper 11.1.1.2.0

    Problem solution
    my backBean:
    protected void limpaSelecaoDaTabela() {
    if (usaPopup)
    if (table != null)
    table.setSelectedRowKeys(null);
    protected void limpaSelecaoDaTabela() {
    if (usaPopup)
    if (table != null)
    table.getSelectedRowKeys().removeAll();
    }

  • How to Remove the "Analyze..." link from Discoverer Gauge Portlets

    Is there a way (a hack, even?) to remove the "Analyze..." link from the Discoverer Gauge portlets? Or, can we redirect that link to point to a different Discoverer Worksheet?
    As a work-around, we're using an HTML portlet below the gauge to link where we want to go, but the "Analyze..." link is still there, so it's confusing to the end user.
    Thanks!

    One quick statement : These customizations are not supported by Oracle. These notes are purely for informational purposes. We cannot guarantee the ability to upgrade your Discoverer environment if you make these changes. Also note that if you want to log TARs and/or bugs against the Discoverer portlets after you have made any of the changes listed in the note shown above, Oracle Support can ask you to back out any changes and reproduce the problem.
    Thanks
    Keith
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Beans http://www.oracle.com/technology/products/bib/index.html
    Discoverer: http://www.oracle.com/technology/products/discoverer/
    BI Software: http://www.oracle.com/technology/software/products/ias/devuse.html
    Documentation: http://www.oracle.com/technology/documentation/appserver1012.html
    BI Samples: http://www.oracle.com/technology/products/bi/samples/
    Blog: http://oraclebi.blogspot.com/

  • Can i remove the words "created in  trial version" from a file now i have purchased full version?

    Can I remove the wording " created in trial version" from a video now i have purchased the full version?

    Presumably a Premiere Elements question. For future reference note that Premiere Elements has its own forum and you should post further PRE questions there. But the answer to your question is in the PRE FAQ entry - http://forums.adobe.com/thread/433730?tstart=30.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • I removed the applications of photoshop en lightroom from my computer after the free trial. Now I have a paid contract and I cannot download the apllications. What to do?

    I removed the applications of photoshop en lightroom from my computer after the free trial. Now I have a paid contract and I cannot download the apllications. What to do?

    Hi, sad isn't it!
    Is this a PPC iMac, or an Inel iMac?
    If PPC...
    TenFourFox is the most up to date browser for our PPCs, they even have G4 & G5 optimized versions...
    http://www.floodgap.com/software/tenfourfox/
    In fact, it will run on Imtel Macs upto 10.6.8 also.

  • Removing the Last Security Update

    I would like to remove the last security update (I think it's - Security Update 2007-002 (Universal) - Security Updates ) - to see if it's what messed up 1 application - (that's the only thing that's changed).
    and No - I didn't do a backup prior to the install... (too bad)
    Q: how do I manually remove the last security update

    Hi Rev Dave;
    What application?
    Maybe if you tell us that information we might be able to tell you if the Security Update might be causing this problem.
    Removing an update is non-trival task especially if you don't have a backup.
    Allan

  • Setting the name of a new object from a string

    Is there anyway I can set the object name of a newly created
    object from a string?
    eg.
    (the code below generates a compile time error on the
    variable declaration)
    public function addText(newTxt:String, txt:String,
    format:TextFormat):void {
    var
    this[newTxt]:TextField = new TextField();
    this[newTxt].autoSize = TextFieldAutoSize.LEFT;
    this[newTxt].background = true;
    this[newTxt].border = true;
    this[newTxt].defaultTextFormat = format;
    this[newTxt].text = txt;
    addChild(this[newTxt]);
    called using>
    addText("mytxt", "test text", format);
    I could then reference the object later on without using
    array notation using mytxt.border = false; for example
    There are many a time when I want to set the name of a new
    object from a string.
    In this example I have a function that adds a new text object
    to a sprite.
    The problem is, if I call the function more than once then
    two textfield objects will exist, both with the same name. (either
    that or the old one will be overwritten).
    I need a way of setting the name of the textfield object from
    a string.
    using
    var this[newTxt]:TextField = new TextField()
    does not work, If I take the "var" keyword away it thinks it
    a property of the class not an object.
    resulting in >
    ReferenceError: Error #1056: Cannot create property newTxt on
    Box.
    There must be a way somehow to declare a variable that has
    the name that it will take represented in a string.
    Any help would be most welcome
    Thanks

    Using:
    var this[newTxt]:TextField = new TextField()
    is the right approach.
    You can either incrment an instance variable so that the name
    is unique:
    newTxt = "MyName" + _globalCounter;
    var this[newTxt]:TextField = new TextField();
    globalCounter ++;
    Or store the references in an array:
    _globalArray.push(new TextField());
    Tracy

Maybe you are looking for

  • My photos are not showing up in the 'Open File' window

    When I try to access my Aperture library through the 'Photo' button on the left hand column of the open file dialogue box, I see an option for aperture but it brings up an incomplete version of my library. There do not seem to be any other versions (

  • Paraller Query Server Error while creating the database using DBCA on UNIX

    Hi All, I am try to create the database on UNIX PLATFORM database 11g R1. At the end of database creation using DBCA i got the errors: ORA-12801:error signaled in parallel query server P077 ORA-00018: maximun number of sessions exceeded ORA-06512:at"

  • Trackable fields odn response message

    Hi, I've developed a routing service with both request and response message. Then I went on ESB console to configure Trackable Fields. When I try to set a Trackable Fiels on a response message the combo box "Message" lost the value, living a blank di

  • Assigning authorization code to a directory number

    Hello, I have a challenge and i will like your assistance. I have been aske to assign the individual force authorization code to the users' directory number, how possible is it? If possible how can it be done. I have a the CUCM version 7.1.5..... Tha

  • Gmail Webmail smaller than size of mail app i

    My Gmail thru webmail shows that there are 20 GB of space being used, yet in my Mail app, the size of the mail box is 50 GB, why so much more in the app vs the webmail? thanks