Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Create text file from variable adds rubbish characters

    Scheduled Pinned Locked Moved Support
    actionsbuildmaster
    4 Posts 1 Posters 6 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      hi, Using Buildmaster 4.1.0 (B28) - the action to create a text file from a variable puts 3 rubbish (extended ascii) characters at the beginning of the file.

      It does not seem to matter how the variable is set (i.e. by "Set Variable Value" action or set from contents of a file).

      Product: BuildMaster
      Version: 4.1.0

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        If I had to guess, there's a BOM at the beginning of the file. Any way to create the file without that?

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          In the "create file" action properties, the file contents is only %VAR_NAME%. E.g. set variable action sets VAR_NAME=XXX

          The file is created with the correct variable value but with 3 extra bytes at the beginning.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            We'll be adding some options to control text encoding for the actions which create a text file in 4.1.1, but in the meantime if you want to strip out the byte order marker, it should work to add a Search/Replace File Contents action immediately after the create file action that matches only the created file. Then, enable the Use Regular Expression option and put in a Regex that will match nothing, such as ^$

            The Search/Replace action should strip out the characters at the beginning of the file. Alternatively, it would be pretty straightforward to create an alternative Create File action that never writes a BOM using the script repository feature added in BuildMaster 4.1.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation