locked
Removing a Carriage Return after published data RRS feed

  • Question

  • Hello,

    I am trying to specify a command with multiple published data items but i am finding that after the first published data then it places in a carridge return, i have done a massive amount of testing using append file, find and replace txt etc but everytime i see this carridge return

    example

    Append File Activity

    File: Test.txt
    File Encoding: Auto

    Append
    Text
    {Name from published data1} {Number from published data2}

    this outputs to a file as

    Technect
     123

    how can i get it to say
    Technet 123

    i have simplied this some what to what i am trying to do, in reality i am trying to use Run Program Activity to run a command using a ip address and a file but the file is not found due to the carridge return and errors out

    Any help is very much greatful

    Thanks



    • Edited by PRK2012 Friday, June 8, 2012 12:55 PM
    Friday, June 8, 2012 10:17 AM

Answers

All replies

  • Hello,

    I would do this with the "Run .Net Script" with Powershell:

    $str1 = "{Pure Output from "Run Program"}"
    $return = $str1.Replace("`n", "")

    Best regards,

    Stefan


    German Orchestrator Portal , My blog in English

    Friday, June 8, 2012 1:49 PM
    Answerer
  • Hello i have tried your suggestion but i am getting the same result, what i have done is below is show you how the data is being outputted into a text file using the append file activity.

    i beleive it's because i have 2 published values on the same line this must not be possible.

    Friday, June 8, 2012 2:36 PM
  • I think it's in your data. I just tested this and I don't get a line break when I have 2 published data items on the same line. Have you tried to replace `r instead of `n?

    Friday, June 8, 2012 2:54 PM
  • Hi,

    can you modify to:

    $commandLine= "E:\iolo..."

    $commandLineResult = $commandLine.Replace(....

    and then publish $commandLineResult

    Regards,

    Stefan


    German Orchestrator Portal , My blog in English



    Friday, June 8, 2012 3:01 PM
    Answerer
  • I already had Commandline as published data, however i have made the change you suggessted above and i get the same result with a carriage return

    i have also tried the recommendation of using 'r as well as 'n, still no joy :(


    • Edited by PRK2012 Friday, June 8, 2012 3:13 PM
    Friday, June 8, 2012 3:12 PM
  • What is the activity that's creating the published data?
    Friday, June 8, 2012 3:24 PM
  • where the carriage return happens is published data from a sql query, however i have considered already that this might be the reason and tried it with other published data items and it still brought in the carriage return
    {ilousername}{ilopassword]

    User123
    Pass123

    i got a feeling it's going to be something silly like a corrupt runbook causing this

    Friday, June 8, 2012 3:53 PM
  • So, since now my last idea:  ... .Replace("`r`n", "")

    Make sure to use " ` " not " ' ".


    German Orchestrator Portal , My blog in English


    Friday, June 8, 2012 5:37 PM
    Answerer
  • Thanks Stefan i just tried this and still on joy, still get a carriage return

    I created a new runbook and used the get lines activity to take 2 values from a txt file, i then used the append line activity using the 2 published data values in the same line and i get the carriage return again, i guess this is a feature or a bug of SCOrch :(

    really frustrating....

    Tuesday, June 12, 2012 4:20 PM
  • Hello,

    if you want you can get the example Runbook which is working in my environment from here: http://sdrv.ms/MAR6i8

    Stefan


    German Orchestrator Portal , My blog in English


    Wednesday, June 13, 2012 5:34 AM
    Answerer
  • Thank you Stefan i followed your example to append my command as 2 separate lines (where the carriage return happens) and then read them with flatten data Run behavior (separate with line breaks) i then ran the powershell script to remove the carriage retun and no appended my Run Program Activity with the output from the script, works fantastic.

    Thank you very much

    Wednesday, June 13, 2012 9:48 AM