Results 1 to 6 of 6

Thread: Import a Binary file to LAE

  1. #1
    Contributor
    Join Date
    Feb 2011
    Location
    Lisbon
    Posts
    98

    Question Import a Binary file to LAE

    Hi,

    I want to import a Binary file, and I don't know which node to use and how.
    I have the specifications for the fields (i know the first field goes from position 0 to position 4, and its a long format), but I must have a node that automatically converts binary.

    I tried to search in the forum, but was unable to find the solution.

    Regards,
    Natanael Moreira
    NOS

  2. #2
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    172

    Default

    Have you tried using Fixed Format File node?

  3. #3
    Contributor
    Join Date
    Feb 2011
    Location
    Lisbon
    Posts
    98

    Default

    Hi,

    Yes I've tried.
    For example, i know the first two field are:
    lproc_date,0,4,long:volume,4,4,long

    But it gives error saying "invalid literal for long() with base 10: '[a\x93P'". Maybe I'm doing something wrong.
    If I change from long to string, it does run the node, but it did not convert the binary code, because the result come in strange characters.

  4. #4
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    172

    Default

    You have a value '[a\x93P' in your data? I'm not sure what that would be converted to. What value were you expecting to see?

  5. #5
    Contributor
    Join Date
    Feb 2011
    Location
    Lisbon
    Posts
    98

    Default

    The file I want to import is in binary code, if I open in a normal notepad, it gives what's in the attached image.
    Binary_Code2.png

    So the node need to translate from binary in order to give the right value.

  6. #6
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    172

    Default

    I don't believe there'll be any node out of the box that will translate that value you've shown. It's not obvious to me what you would expect this value to be translated to. I would bring in that data as unicode and from there work out how you need to convert it. You might need to write something with the Python node. Python seems to have some binary converter options that might help you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •