Forum Discussion

walkerline117's avatar
walkerline117
Contributor
7 years ago

Split a binary string based on the length

Hi

Say I have some binary content which is 12000 bytes long.
I want to build a pipeline that chops the whole binary into different parts every 4000 bytes.
so 1 to 4000 bytes will be in one column, 4001 to 8000 bytes will be in 2nd column and 8001 to 12000 will be in 3rd column so on and so forth.

How to achieve that in Snaplogic?

Thanks

1 Reply

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    @sdoscher

    I guess you should add the absolute path of the directory where the file needs to be created(in the Target path field).

    BR,
    Spiro Taleski

    • sdoscher's avatar
      sdoscher
      New Contributor III

      Thank you @Spiro_Taleski. Conceptually, I understand that, however, I am struggling with the syntax. Any insight you can offer on the below?

      This works (but only in top level of doc library):
      ‘Mx_Manual_Ltrs_’ + Date.now().toLocaleDateTimeString({ timeZone: “EST”, format: “yyyy-MM-dd” }) + ‘.xlsx’

      This is what I tried for the absolute path to put the file in a subdirectory of the same library.
      This does not work.

      https://mln.sharepoint.com/:f:/r/sites/MxLettersTeamPeerReview/Shared%20Documents/Reports’+'Mx_Manual_Ltrs_’ + Date.now().toLocaleDateTimeString({ timeZone: “EST”, format: “yyyy-MM-dd” }) + ‘.xlsx’

      The error I get is:
      Either source/target drive (%s) is not found in the tenant
      Resolution:
      verify if the drive name exists in the tenant.
      Reason:
      The drive name you have entered might not be available in the tenant.

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    @sdoscher

    Did you try to disable the expression button for “Target path”?

    If disabled, it should suggest the document library/libraries within the RxLettersTeamPeerReview Site.

    Then from there, probably you can see/construct the exact path.

    BR,
    Spiro Taleski

  • sdoscher's avatar
    sdoscher
    New Contributor III

    @Spiro_Taleski Thank you. Ironically, I just got help from a co worker who showed me the syntax. Basically, I did not need to put the entire path of the site. The correct syntax ended up being:

    “/Reports/”+‘Mx_Manual_Ltrs_’ + Date.now().toLocaleDateTimeString({ timeZone: “EST”, format: “yyyy-MM-dd” }) + ‘.xlsx’

    Where “Reports” is the sub dir (under the Doc Library “Documents”) that I put the file.

    Thank you again, so much, for being willing to help.