KNOWING WHETHER IT IS ASCII (OR) BINARY

I get different types of files into my Java program that needs to know whether a given file is binary or ASCII. I cannot depend on the extensions because there are a lot of non-standard ones. Is there a way how I can know whether a file is just ASCII text or is it in binary form?

I am trying to compare two flat files both of which need to just contain ascii or unicode words separated with tabs (or someother delimiter). Before doing so, I just want to check the partial content of both the files that none of them, by accident, is a binary file.

Similar Messages

  • ASCII to binary conversion

    Does anyone knows how to convert the ASCII value to binary? For example
    ASCII 'U' to 01010101?

    Hi,
    If I understood you correctly, you want to convert a character eg:'U' to
    its ASCII value which is 85 (in binary representation 01010101).
    With the following method you can convert the first character of a string to
    a one byte long unsigned integer.
    method BaseClass.CharToInt(input pStr: Framework.string): Framework.ui1
    begin
    return *(pointer to ui1)(*(pointer to pointer)(&pStr));
    end method;
    See also the attached .pex file for some more, usefull little methods...
    Regards,
    Tamas Deak
    -----Message d'origine-----
    De: Sing Nyguk Ling [mailto:Thomas.Lingbass.com.my]
    Date: dimanche 12 mars 2000 09:49
    À: kamranaminyahoo.com
    Objet: (forte-users) ASCII to binary conversion
    Does anyone knows how to convert the ASCII value to binary? For example
    ASCII 'U' to 01010101?
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • How to know whether balance carry forward has happened or not

    How to know , whether balance carry forward has happened or not for a perticular GL account or for the company code as a whole?

    If the account is a balance sheet account, you can merely look at the beginning balance for the same balance sheet account for the beginning of the next fiscal year FS10N. The beginning balance will equal the previous year's ending balance. Since this does not happen automatically, you will know that carry forward has not been done if a balance sheet account has no beginning balance in the following fiscal year.
    If you are talking about For P&L GL accounts, you can check the acvitity in the retained earnings accounts to make sure that they have been updated for the P&L activity. You can identify the retained earnings account by looking at the master data for the account in the section "P&L statmt acct type" and pulling up the menu to see the actual retained earnings account number.
    You can perform carry foward (GVTR) as many times as you want but normally once it has been ran, any postings to a  previous fiscal year are automatically carried forward to the current year after that initial run.

  • Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal, How can i know whether my phone is in use??

    Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal bcz it seems to be wiped out all data including settings. it might be in use somewhere turning new fresh Gadget.  How can i know whether my phone is in use??

    You would know for a fact if the device is in use, but if you go back to the find my iPhone app in iCloud.com, you can either select to erase it, or place it in lost mode, in which case, once the device makes a connection to the internet, it will automatically go into that mode.

  • I want to upgrade my storage plan in icloud. Before that i want to know whether synchronization of data in my PC and data in one of the applications of ipad is possible through icloud or not

    I want to upgrade my storage plan in icloud. Before that i want to know whether synchronization of data in my PC and data in one of the applications like "phone drive" of ipad is possible through icloud or not?

    The Photos app doesn't currently support subfolders, it only has the one level of folder/album. You will either need to change your folder structure on your computer to be just one level, see if there is a third-party photo app in the store that copes with subfolders, or just make do. You can try leaving feedback for Apple : http://www.apple.com/feedback/ipad.html

  • How can i add videos,movies and tv shows episodes to my ipod nano?I want to know whether i can directly add them through my pc or not without downloading them from i tunes store?

    how can i add videos,movies and tv shows episodes to my ipod nano?I want to know whether i can directly add them through my pc or not without downloading them from i tunes store?

    Yes, you can add your own videos to iTunes, then sync them to your nano, subject to supported max resolution limit and file type.  The specs for the 7th gen nano says (I don't know which nano model you have), Video Format Support
    "H.264 video: 720 by 576 pixels, 30 frames per second; Baseline, Main, and High-Profile level 3.0 with AAC-LC audio up to 256 Kbps; 48kHz; stereo audio in .m4v, .mp4, and .mov file formats
    MPEG-4 video: up to 2.5 Mbps, 720 by 576 pixels, 30 frames per second; Simple Profile with AAC-LC audio up to 256 Kbps; 48kHz; stereo audio in .m4v, .mp4, and .mov file formats"
    http://www.apple.com/ipod-nano/specs.html
    (earlier nanos have lower max resolution limits)
    So, "HD" video is too high resolution, so iTunes will not sync such videos to the iPod (although they play in iTunes).  If you are asking how to set up iTunes to sync videos in general (regardless of source), please post back.

  • How can I know whether the Servlet is sending a response!!!

    Hello,
    My question is this :
    How do I know whether that server outputstream is sending me a response or not?
    I have opened the Client InputStream to recieve a response from a servlet,but how
    can i be sure that i will receive a response from the servlet?
    I cud be waiting for an 15 expecting a response but havent received one..
    Is there any way to check whether the servlet is sending me a response?
    The reason I am asking is this.
    I have written a Java Client that connects to a servlet.It has to wait for a
    response from the servlet.It will wait for 5 seconds and if this doesnt recieve
    a response,it will return back else it will display the response.
    I have set a timer on my client for 5 seconds and a timer on the servlet for 15 seconds.
    Essentially,when the client connects,the servlet response is held for 15 seconds
    and the client tries for 5 seconds.
    But the client is unable to exit without a response.The response comes back in 15 seconds.
    The client shud have the message 'Connection Timed Out' after 5 seconds.
    This means there is an error somewhere.
    As the response takes 15 seconds,the client shudnt recieve one.
    So,is there a way I can block the servlet response?
    I am using threads and Inner classes for the timer purposes..
    Please can any one help me?
    ajay
    Client code:
    public class HttpHandler {
    private static String sURL="localhost";
    static String sMessage="Hello Server..Client sending Data";
    static DataInputStream dis = null;
    static HttpURLConnection hpCon=null;
    public static void main(String[] args)
    sendData(sMessage);
    public void TimerTest() {
    NewThread nt = new NewThread();
    public static void sendData(String sMess)
    String response=null;
    try{
    // Invoke Timer
    new HttpHandler.TimerTest();
    URL url=null;
    String uri = "http://" + sURL + ":8080/servlet/threads.Recieve_Http_Data1";
    url = new URL(uri);
    hpCon=null;
    hpCon = (HttpURLConnection)url.openConnection();
    hpCon.setDoOutput(true);
    hpCon.setDoInput(true);
    // Transfer Data over http
    DataOutputStream dos = new DataOutputStream(hpCon.getOutputStream());
    dos.writeUTF(sMess);
    }catch(IOException e)
    {System.out.println("Error in Client " + e); e.printStackTrace();}
    } // End of Method sendData
    // Inner Class
    class NewThread extends Thread
    String response;
    int i=0;
    NewThread()
    start();
    public void run()
    try {
    while(i < 5)
    System.out.println(i);
    Thread.sleep(1000);
    try {
    dis = new DataInputStream(hpCon.getInputStream());
    response = dis.readUTF();
    // If response recieved, break off else Loop back.
    if(dis !=null)
    System.out.println("SERVER RESPONSE : " + response);
    dis.close();
    break;
    }catch(IOException e){System.out.println("Here : " + e);}
    i++;
    } // End of While.
    }catch(InterruptedException e){}
    The Servlet
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    import java.math.*;
    public class Recieve_Http_Data1 extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html";
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    doPost(request,response);
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    System.out.println("Server Ready to receive Message from application :");
    System.out.println();
    BufferedReader br=null;
    // Data Read by the Servlet
    String sMess="";
    DataInputStream dis = new DataInputStream(request.getInputStream());
    sMess = dis.readUTF();
    System.out.println("Received from Client: " + sMess);
    // Send response back after 15 seconds Only.
    try {
    for(int i=0;i<15;i++)
    System.out.println(i);
    DataOutputStream dos = new DataOutputStream(response.getOutputStream());
    String sResponse = "Hello Client...This is server sending response";
    dos.writeUTF(sResponse);
    Thread.sleep(1000);
    }catch(InterruptedException e){}

    I don't know whether you solve your problem or not! Anyway, I have the same problem. The program hangs when getInputStream is called.
    DataInputStream dis = new DataInputStream(request.getInputStream());
    If you have the answer, please let me know. Thanks!!

  • Does anyone know whether BT has a mail server that...

    Does anyone know whether BT has a mail server, other than mail.btinternet.com, that supports only POP3/SMTP and not IMAP?  For those interested, the background is as follows.
    I've been trying to get my iPad Mail client to connect to mail.btinternet.com using POP3/SMTP.  When you try to set up an email account on the iPad in the normal way, you are not given the choice of using POP or IMAP.  The Mail client appears to query mail.btinternet.com and, if it determines that the server supports IMAP, it then proceeds to set up a connection using IMAP.  Now, I know a workaround to force the Mail client to connect using POP3/SMTP.  That is not the problem.  The problem is that Mail client does not appear to work properly with POP3/SMTP, and I suspect this is because some of the Mail client code, under the covers, still believes it is using IMAP.
    For example, having setup an email account that uses POP3/SMTP, if I try to create a local mailbox/folder on the iPad Mail client, the operation fails with the message "Unable to Create Mailbox The mailbox couldn't be created on the server".  So I ask myself, why is the Mail client trying to create a mailbox/folder on the server?  The conclusion I have come to is that the Mail client still thinks it is using IMAP.
    I suspect that there are defects in the iPad Mail client code.  But, to test this, it would be good to experiment by setting up a connection to a mail server that supports only POP3/SMTP and not IMAP and then see whether the Mail client behaves any differently.  Hence my initial request.
    Solved!
    Go to Solution.

    Both my wife and I use the Outlook mail client on Windows for our "serious" email and we are very happy with Outlook.
    The iPad is actually my wife's and she bought it for other reasons, such as to Facetime friends and relations, install the Kindle app and read Kindle books, use the BBC iPlayer app, and so on.  But I have set up a separate btinternet email address for her to use on the iPad and she intends to give that email address only to certain close relations.  But, so far, we have found that the iPad Mail client is just not usable with POP/SMTP, and she doesn't really want or need to use IMAP.
    Edit:  Sorry, forgot your specific question.  No, it doesn't create the folder/mailbox locally.  It fails completely.

  • How do you know whether to choose windows or windows 7 64 bit cd for installation

    How do you know whether to install the windows or the windows 7 64bit pretrial cd for photoshop elements 10

    Do you know which version of Windows 7 you have?  Is it Windows 7 64-bit or 32-bit?  One way you can discover this is to right click on Computer and select properties.  Look under the heading of System type.

  • I just want to know that if I buy an iphone 4S here in melbourne can i use it in china? i don`t know whether it`s locked or not and i don`t know what`s the network in china as well. Can somebody please help?I am really in a hurry to know it. Thanks a lot.

    I just want to know that if I buy an iphone 4S here in melbourne can i use it in china?
    i don`t know whether it`s locked or not and i don`t know what`s the network in china as well.
    Can somebody please help?
    I am really in a hurry to know it.
    Thanks a lot.
    P.S: For the iphone 4S. is there any difference for the one from online shop or the actual store?

    iPhones purchased from the online Apple Store in Australia will be unlocked. To the best of my knowledge, unlocked iPhone are not available from the physical Apple Stores at this time, though you can call the Apple Store in Melbourne and inquire.
    Note that the warranty on iPhones is not international, so if you purchase an iPhone in Australia and it needs service, you would have to ship the iPhone to someone in Australia to take or send to Apple for service and then ship it back to you.
    Regards.
    (Note for any readers: this is an old thread and I posted before noticing the date, but decided to leave my reply in case anyone else finds the thread and has the same question).

  • How to know whether my Windows Phone 8.1 App is Associated with the store or not?

    How to know whether my Windows Phone 8.1 App is Associated with the store or not? 
    I have an Windows Phone 8 app already in the store , Now i upgraded it to 8.1 it got upgraded to Windows Phone Silverlight 8.1.
    Now iam trying to use Single Sign on feature on this app but it is showing the error message like
    the App is not Configured correctly i followed the process from  Signing users in to OneDrive
    please guide me how to do this?
    Mohan Rajesh Komatlapalli

    You should post to publish forum.

  • I currently run the Design and Web Premium CS6 on a first generation MacBook Air and want to buy a new MacBook Pro. How do I know whether I can install my Adobe programs onto the new computer? Because I know there is some kind of limit.

    I currently run the Design and Web Premium CS6 on a first generation MacBook Air and want to buy a new MacBook Pro. How do I know whether I can install my Adobe programs onto the new computer? Because I know there is some kind of limit.
    Also, I had to install the software twice on my same computer before because I had to reboot the computer. I don't know if this affects the limit.

    You are allowed to have two activated installations so there should not be a problem having working installations on the two machines.  If by chance you have somehow tied up two activations for the one machine you can have Adobe support help resolve that thru chat.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • I have a 2009 13"MacBook pro running on OS X 10.6.8.  How do I know whether this is leopard or mountain? What would you advise that I use as I need to be running OS X 10.7?  All help appreciated.  Thank you.

    I have a 2009 13"MacBook pro running on OS X 10.6.8. 
    How do I know whether this is leopard or mountain?
    What would you advise that I use as I need to be running OS X 10.7? 
    Also can you advise how I upgrade please?
    All help appreciated.  Thank you.

    Thank you for your response Niel.
    I do run Microsoft Office 2011 - will Snow Leopard support this?
    Finally why snow leopard and not mountain lion?

  • I don't know whether to get a new MacBook or not.....

    I have a 2007 MacBook. Cheapest one you could get, with the small screen. Specs are:
    - 2GHz Intel Core 2 Duo Processor
    - 1GB 667 MHz DDR2 SDRAM
    - Snow Leopard 10.6.8
    When I go to get HD information it says this:
    Capacity: 79 GB
    Available: 47 GB
    Used: 32 GB on disk
    Been having a lot of problems. When I updated to Snow Leopard, things seemed to be better, but have progressively gotten worse. I tried cleaning up a lot of my files, but it doesn't seem to help. It goes SO slow (takes a full minute to open Safari, etc). The fan constantly runs. The batterly lasts about 30 mintues when not plugged in, it says I need a new one (don't know how much they cost?). I don't know whether to take it in or not. Would it be worth anything? There is nothing wrong with the disc drive. What should I do....

    you can get a general value of what your mac is worth by entering info here: http://www.mac2sell.net/.  A new battery costs roughly $129 USD installed by Apple.

  • How do I know whether my DV video camera is FW400 or 800 ?

    Previously, I tested my Panasonic DV video camera with the old iMac. It cannot capture & doesn't work on USB. But it worked on Firewire. But I cannot remember whether it was FW400 or 800 as it has both. I decided not to buy then bcos I was told a new iMac or possible a MacMini is coming out soon. So I wait.
    But now that it has been refreshed, I was told that it comes only in FW800. How do I know whether my DV video camera is FW400 or 800 ?
    Thanks

    Pretty much anything you need to know about Firewire - including the plug and connector types can be found at http://en.wikipedia.org/wiki/FireWire
    However, if you post the exact model number of your camcorder, chances are we'll be able to tell you for sure what it has!

Maybe you are looking for

  • Item text in BAPI_PO_Change

    Dear Expert, I used BAPI_PO_Change for add the item text. text = 'Completed'. s_bapimepotext-TEXT_LINE = text. call function 'BAPI_PO_CHANGE'   exporting     purchaseorder                = p_ebeln TABLES    RETURN                       = i_return   

  • Export Quicktime Movie only exports fades and composites (FCP6)

    I'm trying to add a couple of lower thirds and a fade in and out to a live capture of a lecture; but for some reason, it's only exporting the effects - the fades and lower thirds. Everything else is skipped in the final QT movie. I right-click the se

  • Migrating roaming profile from Windows 2000 TS to Windows 2008 R2 RDS

    We have one TS running on Windows 2000. There are over 200 TS users. We are planning to migrate it to Windows 2008 R2. What's the easy way to migrate the roaming profile? Base on this article Support guidelines for migrating roaming user profiles dat

  • New pocketmac 4.1 and problems syncing contact pics and no full powerPC support.

    i just got the new pocketmac 4.1 in hopes that it would support syncing of 'contact images'.  I have set up my apple address book to show an image for each of my contacts and was hoping it would be able to sync over.  (doing this manually would take

  • Open .ebt file

    Hi. I'm trying to download this document : http://www.doc88.com/p-7082906882637.html or this : http://www.doc88.com/viewer.swf?p1=7082906882637 . Seems to be a simple swf file (embedded in the page) named viewer.swf. Actually this is only a player, t