Binary file format to Ascii format

Hi,
I have a file in binary format in app server. I want to read the file in Binary mode and write that in legacy text mode. Problem here is... when I read that file in binary mode and passing to internal table. First record was fine from the second line carriage return(##) messing up my format. Anybody has any idea.
Thanks
Raj

hi,  you can try some class like CL_ABAP_CONV_XXX,  E.G. CL_ABAP_CONV_IN_CE.
some of them support us to convert Binary code convert into Text.

Similar Messages

  • How to convert binary file to a particular format?

    Hi,
    I am having a requirement. I have in database various kinds of files stored as binary format. Its a sybase database. Now the files can be .pdf, or .doc also. But they are stored in binary format.
    I need to read the file from database.
    Now I can use jdbc to read the particular column value which contains the file in binary format.
    But tricky part is how to convert the binary file entry in a proper respective file format? So I have another column which basically has the value to tell the type of file. So I have ".doc" or ".pdf" as each entry of file...
    So please help me how can we do this using Java?
    THanks

    Hi,
    I am having a requirement. I have in database various
    kinds of files stored as binary format. Its a sybase
    database. Now the files can be .pdf, or .doc also.
    But they are stored in binary format.
    I need to read the file from database.
    Now I can use jdbc to read the particular column
    value which contains the file in binary format.
    But tricky part is how to convert the binary file
    entry in a proper respective file format? So I have
    another column which basically has the value to tell
    the type of file. So I have ".doc" or ".pdf" as each
    entry of file...
    So please help me how can we do this using Java?
    THanks

  • Write output to binary file in C/C++?

    How can I write output to a file in binary format instead of ascii?
    Or... if I am using a buffer.. to write a buffer to binary format instead of ascii?
    I am writing a lot of data to a text file and I would like to reduce the size by writing it all into a binary file instead of ascii?
    Last edited by kdar (2012-12-13 14:36:41)

    Basic I/O?
    char buffer[100];
    // C++ style
    ofstream file;
    file.open ("data.bin", ios::out | ios::binary);
    file.write(buffer, sizeof buffer);
    /* C style */
    FILE* file2 = fopen("data2.bin", "wb");
    fwrite(buffer, sizeof buffer, 1, file2);
    A lot of people prefer the old C style functions for binary i/o even in C++ (and iostream for formatted i/o). Writing and readong more complex structures requires some castin, in C++ usually done with reinterpret_cast<char*>(someStructure).

  • How to Convert Binary Data in Binary File

    hi,
    my telecom client puts a binary file which is asn.1 encoded with BER.
    how to handle binary data in java.
    how to convert binary to hexa to ascii format
    how to convert binary to octet to ascii format
    please help me in this.
    regards,
    s.mohamed asif

    You don't need to convert the data.
    Only you can do is print it in that formats, like it:
    public static String byteArrayToHex(byte[] b) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < b.length; i++)
             sb.append(Integer.toHexString(b&255) + " ");
    return sb.toString();
    take a look at this
    http://java.sun.com/docs/books/tutorial/essential/io/

  • Read binary file 10 bytes at a time

    I want to read binary file in a specific format. There is a number at the starting of the file. That tells us where the data is starting. Suppose it says 3975, then it mean data starts at 3975. Then once I read that location I want to read data at 10bytes at a time and then convert it to numeric and display it on graph. I am attaching the file format and the current vi which I am using. please help.
    Solved!
    Go to Solution.
    Attachments:
    topo.zip ‏89 KB

    Ah, the first 10 characters are a string!
    After opening the file, use the Read From Text File with count set to 10.  Then use the Decimal String to Number to convert this string into your "record size".
    NOTE:  The text indicator was just for debug purposes.  You don't really need it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Read record size.png ‏12 KB

  • Writing Binary files  from PL/SQL

    Hi Group,
    I wish to read tables in Oracle and write them in to Binary files in a predefined format, Can any one help me How to write binary data from within PL/SQL.
    UTL_FILE package has support to .txt files only, is there any other way to deal with this problem.

    You can write ActiveX COM components and use Oracle COM Automation too. I plan to do some experiments later in the summer.

  • ASCII format archives Vs Binary format archives

    Hi, I need to know what is the difference between ASCII format archives and Binary format archives, and how can I create each one. Because in this moment I have created a bynary archive with output.format(), but i need the ascii format, so help me please.

    If you mean jar archives they are multiple files compressed into a single JAR archive file. jar is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format., ie it is in binary format.
    When you create a jar you can -0 to store the files without compression, if that's what you mean.
    ascii is an acronym for american standard code for information interchange AFAIK, and that is a seven bit character.
    hope that helps. I'm not sure I understand the question correctly, pardon me if I didn't
    regards

  • Loading Flat file in ASCII format

    Hi All,
        We are loading data from flat file in ASCII Format . Kindly let me know what are the prerequisites we need to maintain when we load data in ASCII Format .
    Cheers!
    Raghu

    Hi Raghu,
    I always load in delimited ASCII. True ASCII format has the advantage of being the fastest way to enter data to BW. But you have to make sure, that the values you import are perfect aligned. So you have to fill in blanks to get the values and characteristics aligned. Delimited ASCII separates by a separator (usually a tabulator or a ";").
    Example:
    ASCII
    10200865678983  10PRODA     2011
    10200865678983  20PRODB     4012
    Delimited ASCII:
    1020;08;8656789383;10;PRODA;20;11
    1020;08;8656789383;20;PRODB;40;12
    Depending on system you may also be careful how you name your files. In Unix you have to be careful in using Upper/Lower case. Win and Unix systems use different ways to access directories. You have to keep this in mind, especially if you wish to use a function to find the filenames you wish to import.
    Also because of Unix or Windows systems you should remember that Unix just need a CR to separate lines, while Windows needs CR/LF. So if you try to import Windows files in Unix systems you will get interesting results. Look at the files you wish to import with transaction AL11. If you see some interesting black cubes at the end of line, you have a windows file you try to load in unix.
    Kind regards,
    Jürgen

  • A string that can be displayed as both ASCII and hex in an indicator will only save the data to a file in ASCII format

    We can see the data in an indicator just fine, but when we try to write that string of hexadecimal data to a file, it will only save the data in ASCII format.  
    This sounds fairly simple, as the indicator can be selected to display the data in several different formats (VI>Properties>Appearance>Display Style: Normal, Backslash...., Hexadecimal).  However, I have been unable, as of yet, to save the data in different formats.
    Solved!
    Go to Solution.

    altenbach wrote:
    ... or you could just read the string:text.text property to get whatever is actually displayed.
    like this...
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    texttextString.PNG ‏6 KB

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

  • ASCII format while loading flat files.

    Hi,
    Please tell me, if i want to load a flat file of
    ASCII format instead of CSV, what shoud be the format of
    the ASCII file is it text document or something else?
    please send me a sample file.
    and what will be the values for this? and are these mandatory?
    1) Separator for Thousands
    2) Character Used for Decimal Point
    3) Currency conversion for External systems

    Hi Gopi,
    Thanks for the suggestions.
    I have one more doubt.
    well i was trying with a sample flat file which contains
    two infoobjects--
    1. empid(key figure) 2.empname(characteristic)
    i created infosource cube everything is fine and when i try to create a infopackage---i mention file name of ACII
    keeping this option. ASCII file which is in a text format
    and i am seperating the data jus by a place.
    when i do preview, instead of getting 2 columns with diff values , i am geting both column values in a single column.
    what should i do for this?
    how to get values in separate columns?
    Thanks,
    Vijaya.

  • Binary file format

    Hello!
    What is the binary file format for files created by Labview's example High
    Speed Data Logger? The header information comes first, but how is the actual
    logged data written in the file? I have logged two channels.
    Thanks in advance for advice.
    Best regards,
    Antti Ryhänen

    The LV code first converts the I16s to U16s and casts it as single-precision floats. It them multiplies the result by a scaling factor that's stored in the data header and adds an offset that's found in the same place.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Binary file of unknown formats

    Hello everybody,
    I posted a message earlier today but unfortunately I missed to give more details about my problem. I am sorry about that. I am a new user of LabView so I still have many things to learn. What I am trying to do is use LabView (8.2) to read a file that was created by UVP Monitor, V3.0 (*.mfprof file).
    This package saves fluid velocity information. There are 65 channels that form a velocity profile in a pipe. Also, there are 4096 velocity profiles, each velocity profile was captured at a time rate of 9 ms. I don’t know what is the format of these values.
    At present, I obtain a text file from UVP Monitor, then process the data using FORTRAN and finally plot the results. I want to avoid this and read the UVP file, process, analyze and plot the data using only LabView. I want to read individual experimental parameters as well as the bulk of the data. In this way the user has different options to choose from before processing and plotting the results. I actually built a VI that processes and plots the text files and it runs great.
    The problem I am facing now is that I want to read the UVP file but I have no information about the structure of it. I am assuming it is a binary file but that is all I can say about it.
    The header and footer seem to be in text format, that is all I can read; however, the body of the file I am not yet able to read.
    The information from the file is sent to the type cast function. Then I set a string indicator in the “Normal” option in Properties. I can read the header and footer but not the body of the file; for the body of the file all I can see is characters of the type
    “C¾ Ü Qþ  X@ “. One of the other options, Password, seems to provide an output of just the characters that were originally written, but then again, I can not read the characters because it is only asterisks and I can not copy them onto a word processor either.
    I have tried other options as well, such as Variant to flattened string and flattened string to variant, flatten to string and unflatten from string. Unfortunately none of them worked.
    I am attaching the VI I wrote and a sample UVP file , I would appreciate if someone could explain to me how to deal with  complex binary files in LabView and share an example with me if possible.
    Regards,
    Roberto
    Attachments:
    BINARY Read UVP file.vi ‏45 KB
    Test UVP file.zip ‏693 KB

    OK, here's a quick draft how you could do it in LabVIEW. Modify as needed, e.g. slice out the interesting columns, etc.
    The header has some binary data that may, or may not, mean something useful.
    See if the data "looks" about right.
    Message Edited by altenbach on 04-26-2007 08:13 PM
    Message Edited by altenbach on 04-26-2007 08:15 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    BinaryRead.png ‏10 KB
    BINARY Read UVP file2.vi ‏46 KB

  • Basic Binary File Does not Read Unless Placed into Exact Format it originated?

    Ok, check this out.  This just does not make any sense to me.  First, you'll need to run it and create the two files.  You're going to get an error at the close.  Now...here's what doesn't make any sense to me.  If you enable the disabled diagram and read that same file, you can look at how the file is being read and the data interpreted.  How is that any different and not causing an error?  I took the U8 and changed it back to its original Boolean Array[8] format and received no error.  Which means the data was read as a U8 at some point.  But...for whatever reason, cannot be read and displayed as a U8.  What's up with that?  What am I not understanding?
    Remember, code does exactly what you tell it.
    Solved!
    Go to Solution.
    Attachments:
    Binary File Issue.vi ‏23 KB

    DailyDose wrote:
    Huh....no read and write.  Either read or write.  Gotcha.
    Not quite.  It is a matter of where the file pointer is.
    The file pointer is what location in the file will be read from or written to, depending on what you do next.  When you write to a file, the file pointer is set to be directly after what you just wrote.  So when you write a new file, the file pointer is at the end of the file.  So when you try to do a read when the file pointer is at the end of the file, an attempt of a read at the end of the file happens.  But there is nothing left for it to read.  Therefore you get an End Of File error.
    So if you just added a Set File Position to set the file pointer to the start of the file, you can read your byte with no error.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Binary File Issue_BD.png ‏25 KB

  • How to view the File created against the Transport Request in ASCII format

    Hi all,
    We have a requirement where in the file created against the Transport reauest and its content should be viewed in ASCII format.
    Experts do you have answer for this.
    Is thers any method to work out.
    Thanks in advance.
    Every usefull answers will be awarded points.*********

    Hi Anji Reddy,
    Thanks for your reply.
    Let me clear my querry.
    when we create a program in se38 and save it in a zxxxx package then it will create a transport request. The Content of TR i mean is not the Program name or the object list in the TR. The content i mean here is the abap code written in the program. which will be stored as a file in the server. when we open this file it will give the SAP format. Which i want to view in ASCII format.

Maybe you are looking for