How to convert TEXT to BINARY

How to convert TEXT to BINARY

i am using Binary Data reference to convert binary to text and vice versa .
i am able to convert file from binary to text easily but when i am converting file from text to binary
it giving me file of 2567 bytes and in next stage i'm assigning output of this to Download widget but i'm getting data format error while doing this . (i am using fuctions given by Binary data XIF  'BinaryDataToText' and 'TextToBinaryData'  )
Please guide me with this.
Thank You !
Hi Pankaj,

Can you explain a bit better what you are trying to do?

So you start with a file (Binary) then convert it to Text and then back to Binary?
if you could upload an eSpace with a sample application with your error would be great.

João Rosado
hello joao ,
yeah i am doing the same thing as you explained . i was trying to do it with  ' TextToBinary ' action inside other action but i was getting error at Download stage coz i need to download this file, then  i copy the same logic and i add it inside Preparation for one new page and its working file. 
Thank You 
sir how can i Scan the Binary file ?. 
suppose i have file with name ABC and it having 100 fields , i want to catch value of each field and assign it in textbox so what will be the best way to do it 
Hi Pankaj,

Its hard to help you when you don't give enough information.
You said it is a binary file, but said nothing about the format of the data inside. We won't be able to help unless you give a concrete example of your file and explain what you want to do with the information (will it be 1 input on the screen for each field? what do you want to do after?)

João Rosado
hello Joao,
This is what i am doing  :

  1.  i want to create EXPORT and IMPORT of file from my system.
  2.  when i click on EXPORT button i am creating .FNM format file with entered data .[ we can open that file in Notepad or Excel ] - Sample Attached.
  3. for export part everything is goin fine

 This is what i want to do :

  1. i want to import the file which i have exported.[ i.e : .FNM file] 
  2. when i browse that file i want to show all the data from that file to my webform. i.e: the field which i use for   export file that should go at there appropriate location after import.
  3. now i am able to convert imported file to text but its not possible to catch value of every field as the file size can be change as per data and it may have 100+ fields.
  4. once you open attachment you will get what i am talking about.

Hello ,

Can anyone respond on it PLEASE ?? 
I really need help on above topic .
Since this has been sitting so long I'll take a stab at it, but you probably won't like my response.

For any platform to manipulate data, it needs to be in some reasonable format.  I have no clue what .FNM is supposed to be but looking at it in Notepad as you suggested shows a complete hodgepodge of data fields scattered through the file with no logical order and no delimiters or other way of identifying individual fields.  You need to do some analysis.

1) Where does this data come from?  If it's something you can control, use some formatting mechanism such as XML or JSON.  If you are stuck with this format I don't believe there is any way to decipher this regardless of the language, platform or technical expertice you use.

2) Once you have this is a usable format you should be able to identify records and fields which will make everything else easier.

This is definitely NOT an Outsystems issue.  Anaylze your use case, use a manageable format and then try this again.

Hope this helps,
I agree with curt, it seems you need to use the text-utils (string split etc.) to actually make some sense out of the imported data.

I am also agree with you curt i already did same for file with reasonable format but here in this case we need to adjust with this format because this files are coming from different applications and we dont know there internal structure or format which they applying to generate this FNM pages.

worst thing is that number of lines in this page can increase or decrease for different files.

J i am using  BinaryDataToText for converting file to text format and then by using string_split action i am storing value in variable, but this is not enough to fulfill all conditions and search.

Is there any other tool that i can use for this condition where i can search for one field and can store value next to it in variable ?
Here's why a tool won't work.  When you search for a field, as you say you want to do, there must be some way to identify that field within the record using delimiters, position relative to other fields, fixed position in a record or something else.  Your file has none of this as far as I can tell.  The variable number of lines is the least of your issues.

You need to work with whoever is providing this data to understand the format and write a custom string parser to decipher it or get them to produce the data in some reasonable format (XML or JSON would be best).  Failing those two events, you could spend years trying to make this work for all possible files you might receive.

I hope you find an answer.

Thanks  Curt !  i will try to contact the providers and if anything i will disturb you again . sorry in advance for that :)