Read Unicode text file convert to ANSI text file

I am new to Java. I am trying to read from, ReadUnicodeEncodedPlainTextDocument.txt, a plain text file encoded
in Unicode, then select four particular lines, and then write those plain text lines to, WriteANSIencodedPlainTextSelectedFields.txt,
another file encoded in ANSI.
Using my code ConvertEncodedText.java:
import java.io.*;
import java.util.Scanner;
public class ConvertEncodedText
     public static void main(String[] args) throws Exception
          File f = new File("ReadUnicodeEncodedPlainTextDocument.txt");
          Scanner scan = new Scanner(f);
          String peek1, peek2, peek3, peek4;
          boolean pk1 = false, pk2 = false, pk3 = false;
          int count = 0;
          while(scan.hasNext())     // begin search
               peek1  = scan.nextLine();
               if (peek1.startsWith("From"))
                    pk1 = true;
                    peek2  = scan.nextLine();
                    if(pk1 && peek2.startsWith("Date"))
                         pk2 =true;
                         peek3  = scan.nextLine();
                         if(pk1 && pk2 && peek3.startsWith("To"))
                              pk3 = true;
                              peek4 = scan.nextLine();
                              if(pk1 && pk2 && pk3 && peek4.startsWith("Subject"))
                                   System.out.println("\n" + peek1 + "\n" + peek2 + "\n" + peek3 + "\n" + peek4);
                                   count++;
                                   pk1 = false;
                                   pk2 = false;
                                   pk3 = false;                                   
                              }//if pk1 && pk2 && pk3 && peek4.startsWith("Subject")), print, begin new search
                              else
                                   pk1 = false;
                                   pk2 = false;
                                   pk3 = false;                                   
                              }//else begin  new search                              
                         }//if(pk1 && pk2 && peek3.startsWith("To"))
                         else
                              pk1 = false;
                              pk2 = false;
                              pk3 = false;
                         }//else begin new search
                    }//if(pk1 && peek2.startsWith("Date"))
                    else
                         pk1 = false;
                         pk2 = false;
                         pk3 = false;
                    }//else begin new search
               }//if (peek1.startsWith("From"))
          }//while hasNext
          System.out.println("\ncount = " + count);
}As shown below, I would like to write to the following text file encoded in ANSI, WriteANSIencodedPlainTextSelectedFields.txt:
From: "Mark E Smith" <[email protected]>
Date: April 9, 2007 11:28:19 AM PST
To: <[email protected]>
Subject: FW: RFI Research Topic Up-date
From: "Mark E Smith" <[email protected]>
Date: May 26, 2007 11:14:12 AM PST
To: <[email protected]>
Subject: Batting Practice Sportsphere
From: "Mark E Smith" <[email protected]>
Date: May 30, 2007 11:53:45 PM PST
To: <[email protected]>
Subject: 3p meeting
From: "Mark E Smith" <[email protected]>
Date: June 20, 2007 4:09:10 PM PST
To: <[email protected]>
Subject: Question
count = 4
In order to produce the above text file,
I would like to read the following text file encoded in Unicode, ReadUnicodeEncodedPlainTextDocument.txt:
From: "Mark E Smith" <[email protected]>
Date: April 9, 2007 11:28:19 AM PST
To: <[email protected]>
Subject: FW: RFI Research Topic Up-date
Hi, Dr. Ulrich.? Are there any authors and titles of JME that you could recommend for my reading??
Thanks.? Mark
From: Joe Greene [mailto:[email protected]]
Sent: Sat 4/7/2007 4:10 PM
To: Mark E Smith
Subject: RE: RFI Research Topic Up-date
Hi Mark,
Thanks for the update. I have met Dr. Ulrich on several occasions ? he is a great guy!
Dr. Hammer and I also have the same advisor from graduate school. He did his Masters with my PhD advisor at Poly-Tech. We have also met many times in the past. I think you will be in good hands down there.
It seems clear that you need to start learning JME and can perhaps forget about Windows Mobile. JME represents a smaller footprint for Java that contains support for various APIs for mobile functionality. I do not own any JME books, but a search on Amazon.com turned up what looks like several good ones.
Best wishes
Joe
----------------------------------------------------&#8232;Joe Greene, Ph.D.&#8232;DCSIT&#8232;it.sdu.com&#8232;[email protected]&#8232;http://www.greene.org
From: Mark E Smith [mailto:[email protected]] &#8232;Sent: Saturday, April 07, 2007 9:30 AM&#8232;To: [email protected]&#8232;Subject: RFI Research Topic Up-date
Welcome to the conversation, Dr.Greene.? This is where we are so far.? I would appreciate your thoughts.
Thanks.? Mark
From: "Mark E Smith" <[email protected]>
Date: May 26, 2007 11:14:12 AM PST
To: <>
Subject: Batting Practice Sportsphere
Saturday, May 26, 2007
Hi, Dr. Ulrich.? This read-sensitive run-recognition pitching distribution is perhaps a commercial problem in a less sophisticated framework.? Could we build a simple commercial application and then customize the solution for the Ballpark functions and framework?? Thanks.? Mark
From: "Mark E Smith" <[email protected]>
Date: May 30, 2007 11:53:45 PM PST
To: <[email protected]>
Subject: 3p meeting
Hi, Dr. Ulrich.? Attached are a few notes from my research of the project docs that you sent me.? I am looking forward to our 3p meeting.??Thanks.? Mark?
From: "Mark E Smith" <[email protected]>
Date: June 20, 2007 4:09:10 PM PST
To: <[email protected]>
Subject: Question
Hi, Dr. Ulrich.? Pine-tar.? What do you think?? Would you please show me how to pitch sliders and splitters into this so I can study the features in detail?? Thanks.? Mark
P.S.
As you can see, my code reads the particular sequence of 4 selected fields, From, Date, To, and Subject,
out of an email that contains that specific sequence of 4 fields then I would like to place them in a text file
called WriteANSIencodedPlainTextSelectedFields.txt, and then print the number of emails in the document.
Instead of the desired output I would like to write to the file WriteANSIencodedPlainTextSelectedFields.txt; I am only getting this:
Count = 0
What is my problem???
Thanks,
Mike

What is my problem???Obviously one of your conditions not being true...
What does your question have to do with the thread's subject, btw?

Similar Messages

  • Photoshop .psd files converted to Unix Executable files

    I'm an illustrator and I store my art on CDs and DVDs. After a period of time my files are converted from Photoshop .psd files to Unix Executable files and I can't open them. What can I do to get my work back??? -and keep this from happening in the future. Why does it do this????
    Thanks for any help.

    The file sizes range from 22.2 MB to 67.9 MB.
    Size isn't the issue then. Linc was asking that question because we see that with other file types. Older fonts in particular, which have all of their data in the resource fork. If that gets stripped, you end up with a zero byte file.
    Does that mean I'll have to go through the Adobe authorization process for Photoshop again?
    If the version of Photoshop you're currently using is already activated, then no. Either way, it has nothing to do with .psd files showing as UNIX executables.
    In Windows, any file that doesn't have an association to a program is displayed as a white, dog-eared piece of paper with the Windows logo in the middle. That's Windows' way of saying, "I have no idea what this is." In OS X, (except for those files which actually are UNIX executables), displaying them as such is OS X's way of saying the same thing.
    I thought I was home free when the icon changed to a thumbnail picture of the illustration, but PS refuses to open it saying it is not a Photoshop file. ???
    Now that is weird. As of Snow Leopard, Apple put the old Type and Creator codes to rest. It will read them as a last resort to try and identify an older file, but none of Apple's applications add them to any file they save. For better compatibility with Windows, and OS X's own underlying UNIX core, file extensions have taken their place. So adding a .psd extension should have worked. Without playing with one of your files, I couldn't tell you why Photoshop declared it wasn't a valid .psd image.
    On a side note, Apple added Uniform Type Identifiers to OS X to keep things separate. A big problem in Windows is that multiple apps may use the same file extension. EPS is a big one in printing. So you have Photoshop, Illustrator, Freehand, Quark and others all using .eps for Encapsulated PostScript files. However, Windows can only associate one application to any given extension. So if Illustrator happens to be the one tagged to .eps files, it will try to open any file ending in .eps, no matter what program actually created it. OS X keeps them separate with Uniform Type Identifiers. So even though multiple files may have .eps file extensions, the extra metadata keeps track of what program it actually belongs to.
    This is what is part of the LaunchServices database, and was why it was my first suggestion. If that database is wonky, you'll see weird things like this. Have you tried clearing it yet?
    The files are fine when newly burned to CD. It is only months, or years, later that they become Unix Executable Files.  This has happened to just about all of my CD backups and it's frustrating to think that CD backup doesn't work across newer OSs and Photoshop upgrades. I suspect that may be the problem, but it just shouldn't happen.
    That shouldn't make a difference. I've got a bunch of very old files created in Photoshop back from OS 8 on CD. No file extensions, as nothing did at the time. Just Type and Creator codes. They all open fine in PS CS5.5 in Snow Leopard, though the native Photoshop files do need to have a .psd extension added.

  • PDF-files convert themselfes to PSE-files!!

    Need help! All my PDF-files suddenly convert themselfes to PSE-files!! PDF-files sent to me as enclosures in e-mails turn up as PSE-files and is of no use to me. And worse: all my old pdfs spared on my computer has been changed to PSE-files. All icons for PDF-files on my desktop have a blue mark with "PSE" in them instead of the red PDF symbol. And it is impossible suddenly to open them as the pdfs they were spared as. The open as unreadable PSE documents.
    I really don't know what to do about it, so I need HELP!
    Leif Wallquist

    Yes, something has changed. WINDOWS has changed. The files have not changed, because this is nothing to do with the file.
    It works like this: there is a "default association" for a file type. Don't worry about the jargon. What it means is that for each type of file (DOC,TXT,JPG,PDF,PSE...) Windows has an app (program) to run. It also, for each file type, has an icon for that app.
    So, if the default association for PDF files is Adobe Reader then, when you double click a PDF, it opens Adobe Reader. And the icon comes from Adobe Reader.
    But, if the default association for PDF files is Photoshop Elements, when you double click a PDF, it opens Photoshop Elements. And the icon comes from Photoshop Elements. This doesn't mean that they are PSE files!
    When you change the association it affects all of the files, BUT the files don't change.
    As I said, you can probably fix this from Adobe Reader's preferences. You can also sometimes fix it in Windows, with the right click - open with - Adobe Reader. Do you have an "always use this program" option? Try it.

  • Image quality issue - PM7 file converted to ID CS4 file

    Hi
    We have converted a Pagemaker 7 file to an InDesign CS4 file.
    The issue we are having is that the quality of the images has dropped.
    We are aware that this is a side effect of the conversion process.
    We then tried to insert the original image file into the InDesign file but the quality is lacking.
    Can anyone give any recommended settings for importing the images into ID without losing any quality?
    Cheers
    Jay

    You may want to follow the recommendations about linked images in the InDesign Help file:
    Before opening the document in InDesign, you may want to do the following:
    If the PageMaker file or its linked graphics are located on a network server, floppy disk, or removable drive, it may not open as
    expected if an interruption in data transfer occurs. To prevent data transfer problems, copy documents and their links to the
    hard disk, preferably in the same folder where the PageMaker publication is stored, before opening them in InDesign.
    You may want to use Save As in PageMaker to clear unnecessary hidden data.
    To ensure that all links are maintained, copy all linked files to the same folder where the PageMaker publication is stored.
    Make sure that all necessary fonts are available in InDesign.
    Repair broken graphics links in the PageMaker publication.
    If you have a problem converting a large PageMaker document, convert portions of the PageMaker file separately to isolate the
    problem.

  • Jar files - convert url to a file

    Hi,
    I'm trying to create a jar file. The name of the package is Multimedia and theres a folder in that called Sound. It creates the jar file fine but I can't access the audio files. I'm using the getResource() method. That returns a url. I need to convert this to a File object. How do I convert it?
    url = testSound.class.getResource("/Multimedia/Sound/"+audioFiles[lsClips.getSelectedIndex()]);
    uri = new URI(url.toString());
    System.err.println("URI "+uri.toString());
    System.err.println("URL "+url.toString());
    soundFile = new File(new URI(url.toString()));This is the output:
    URI jar:file:/C:/PROJECT4/y.jar!/Multimedia/Sound/DMathews.wav
    URL jar:file:/C:/PROJECT4/y.jar!/Multimedia/Sound/DMathews.wav
    Please,please help. I've to hand up this project in the morning.
    Roseanne.

    Thanks so much for the fast answers!
    My code does compile ok. I get a nullPointer exception though - because the file hasn't loaded.
    Thanks Val also.
    In my program I was actually converting the file to an AudioInputStream.
    How would I convert an inputStream to an audioInputStream??
    This is my code:
    is = this.getClass().getResourceAsStream("/Multimedia/Sound/"+audioFiles[lsClips.getSelectedIndex()]);
    //loadAudio(soundFile);
          loadAudio(is);
    public void loadAudio(InputStream is)
        try
          //audioInputStream = AudioSystem.getAudioInputStream(soundFile);
          audioInputStream = new AudioInputStream(is,null,null);
          audioFormat =audioInputStream.getFormat();
    I get this error
    C:\PROJECT4>javac Multimedia/*.java
    Multimedia/testSound.java:402: cannot resolve symbol
    symbol : constructor AudioInputStream (java.io.InputStream,<nulltype>,<nulltype
    )location: class javax.sound.sampled.AudioInputStream
    audioInputStream = new AudioInputStream(is,null,null);

  • How to debug byteCode? Can cap file convert to java source file?

    Are there tools can debug byteCode?
    Are there tools can convert cap file to java source file?
    Are there tools can convert jca file to java soure file?

    I think it's little bit difficult to give you a correct answer. Frankly speaking, cap file debugging is possible if you have sufficient devices and knowledge to do that. Converting cap file to java source code is also possible only if the cap file has descriptor component in it. Names of variables, functions will not be completely restored because cap file doesn't have the names in it. But I am not sure that there is a publicly opened tool to do that. JCVM chapter 6 may show you the way even it's not the direct one.

  • Help! FCE project files converted to unix executable files

    I recently added a USB external drive and put my FCE project files on it. When I rebooted, the files now are unrecognizable by Final Cut Express as project files. In the finder they are now recognized only as unix executable files. Is there any way to reverse this problem. I really can't afford to lose all that work! Thanks

    How is the drive formatted? If it's not Mac formatted you may have a problem. It may be recoverable. How many project files are you talking about? What about the media?

  • Can photo files convert to be .itc2 files?

    Dear Experts,
    Recently I try to import my all CDs to be WAV format into iTunes database, however I tried to download the artwork of my CDs, most of them (90%) can't be found from Apple database.
    I tried to take photos of CDs' covers to import into iTunes by myself but seems to iTunes doesn't support it.
    I would like to know if its possible that i take photos of CDs' covers and covert to .itc2 files (which iTune artwork uses one) and then import to my iTunes database?
    Or is there any method of Apple to let user upload ourt covers photos to iTune artwork database for downloading?
    Your reply will be big appreciated!
    Angel from Taiwan

    I suggest you convert the files to Apple Lossless format. You might find the script ConvertFormat useful.
    tt2

  • Adobe DNG converter is corrupting NEF files. The color is way off and it's not the camera white balance.

    I was using the converter for a few months and it was working fine. Now it will convert the files, but the color is really messed. I know it is not the white balance, because the same files convert fine to TIF files through Nikon's software. I am using this converter for Nikon d610 NEF files. Here's a sample DNG and the same image in TIF. Can anyone help? Thanks!

    When you use the DNG Converter to make a DNG from an NEF, the DNG Converter applies the default Camera Raw settings.  When I open your DNG it looks fine, but when you open it, it looks off.  That is because you've some how set your Camera Raw defaults to have a bunch of customized settings specific to a particular picture, instead of having them all be normal settings.  Below you'll see what Photoshop is saying the settings of the DNG-Converted-JPG are, with the non-defaults marked in bold.  The main problems are the WB being custom and a bunch of HSL setting changes.
    Here is what Photoshop reports that the JPG was created using:
          <rdf:Description rdf:about=""
                xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
             <crs:RawFileName>hug_8290_0215_1.dng</crs:RawFileName>
             <crs:Version>6.0</crs:Version>
             <crs:ProcessVersion>5.7</crs:ProcessVersion>
             <crs:WhiteBalance>Custom</crs:WhiteBalance>
             <crs:Temperature>5732</crs:Temperature>
             <crs:Tint>+26</crs:Tint>
             <crs:Exposure>0.00</crs:Exposure>
             <crs:Shadows>5</crs:Shadows>
             <crs:Brightness>+50</crs:Brightness>
             <crs:Contrast>+25</crs:Contrast>
             <crs:Saturation>-4</crs:Saturation>
             <crs:Sharpness>90</crs:Sharpness>
             <crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
             <crs:ColorNoiseReduction>25</crs:ColorNoiseReduction>
             <crs:ChromaticAberrationR>0</crs:ChromaticAberrationR>
             <crs:ChromaticAberrationB>0</crs:ChromaticAberrationB>
             <crs:VignetteAmount>0</crs:VignetteAmount>
             <crs:ShadowTint>0</crs:ShadowTint>
             <crs:RedHue>0</crs:RedHue>
             <crs:RedSaturation>+11</crs:RedSaturation>
             <crs:GreenHue>0</crs:GreenHue>
             <crs:GreenSaturation>0</crs:GreenSaturation>
             <crs:BlueHue>+12</crs:BlueHue>
             <crs:BlueSaturation>+2</crs:BlueSaturation>
             <crs:FillLight>0</crs:FillLight>
             <crs:Vibrance>-6</crs:Vibrance>
             <crs:HighlightRecovery>0</crs:HighlightRecovery>
             <crs:Clarity>0</crs:Clarity>
             <crs:Defringe>0</crs:Defringe>
             <crs:HueAdjustmentRed>0</crs:HueAdjustmentRed>
             <crs:HueAdjustmentOrange>0</crs:HueAdjustmentOrange>
             <crs:HueAdjustmentYellow>+1</crs:HueAdjustmentYellow>
             <crs:HueAdjustmentGreen>+5</crs:HueAdjustmentGreen>
             <crs:HueAdjustmentAqua>0</crs:HueAdjustmentAqua>
             <crs:HueAdjustmentBlue>-9</crs:HueAdjustmentBlue>
             <crs:HueAdjustmentPurple>0</crs:HueAdjustmentPurple>
             <crs:HueAdjustmentMagenta>0</crs:HueAdjustmentMagenta>
             <crs:SaturationAdjustmentRed>-2</crs:SaturationAdjustmentRed>
             <crs:SaturationAdjustmentOrange>+14</crs:SaturationAdjustmentOrange>
             <crs:SaturationAdjustmentYellow>+25</crs:SaturationAdjustmentYellow>
             <crs:SaturationAdjustmentGreen>+26</crs:SaturationAdjustmentGreen>
             <crs:SaturationAdjustmentAqua>0</crs:SaturationAdjustmentAqua>
             <crs:SaturationAdjustmentBlue>+32</crs:SaturationAdjustmentBlue>
             <crs:SaturationAdjustmentPurple>0</crs:SaturationAdjustmentPurple>
             <crs:SaturationAdjustmentMagenta>0</crs:SaturationAdjustmentMagenta>
             <crs:LuminanceAdjustmentRed>+40</crs:LuminanceAdjustmentRed>
             <crs:LuminanceAdjustmentOrange>+13</crs:LuminanceAdjustmentOrange>
             <crs:LuminanceAdjustmentYellow>+3</crs:LuminanceAdjustmentYellow>
             <crs:LuminanceAdjustmentGreen>+15</crs:LuminanceAdjustmentGreen>
             <crs:LuminanceAdjustmentAqua>+3</crs:LuminanceAdjustmentAqua>
             <crs:LuminanceAdjustmentBlue>+4</crs:LuminanceAdjustmentBlue>
             <crs:LuminanceAdjustmentPurple>0</crs:LuminanceAdjustmentPurple>
             <crs:LuminanceAdjustmentMagenta>0</crs:LuminanceAdjustmentMagenta>
             <crs:SplitToningShadowHue>231</crs:SplitToningShadowHue>
             <crs:SplitToningShadowSaturation>32</crs:SplitToningShadowSaturation>
             <crs:SplitToningHighlightHue>45</crs:SplitToningHighlightHue>
             <crs:SplitToningHighlightSaturation>33</crs:SplitToningHighlightSaturation>
             <crs:SplitToningBalance>+74</crs:SplitToningBalance>
             <crs:ParametricShadows>-39</crs:ParametricShadows>
             <crs:ParametricDarks>-7</crs:ParametricDarks>
             <crs:ParametricLights>-15</crs:ParametricLights>
             <crs:ParametricHighlights>+14</crs:ParametricHighlights>
             <crs:ParametricShadowSplit>25</crs:ParametricShadowSplit>
             <crs:ParametricMidtoneSplit>50</crs:ParametricMidtoneSplit>
             <crs:ParametricHighlightSplit>75</crs:ParametricHighlightSplit>
             <crs:SharpenRadius>+1.0</crs:SharpenRadius>
             <crs:SharpenDetail>25</crs:SharpenDetail>
             <crs:SharpenEdgeMasking>0</crs:SharpenEdgeMasking>
             <crs:PostCropVignetteAmount>-24</crs:PostCropVignetteAmount>
             <crs:PostCropVignetteMidpoint>50</crs:PostCropVignetteMidpoint>
             <crs:PostCropVignetteFeather>97</crs:PostCropVignetteFeather>
             <crs:PostCropVignetteRoundness>0</crs:PostCropVignetteRoundness>
             <crs:PostCropVignetteStyle>1</crs:PostCropVignetteStyle>
             <crs:PostCropVignetteHighlightContrast>0</crs:PostCropVignetteHighlightContrast>
             <crs:GrainAmount>0</crs:GrainAmount>
             <crs:ColorNoiseReductionDetail>50</crs:ColorNoiseReductionDetail>
             <crs:ConvertToGrayscale>False</crs:ConvertToGrayscale>
             <crs:ToneCurveName>Medium Contrast</crs:ToneCurveName>
             <crs:CameraProfile>Adobe Standard</crs:CameraProfile>
             <crs:CameraProfileDigest>51B4314CF8312BA027EF3FC60481FB35</crs:CameraProfileDigest>
             <crs:HasSettings>True</crs:HasSettings>
    To fix the problem you're gonna need to reset your camera raw defaults:
    And then be careful when saving new camera raw defaults with the menu item just above, that your image has the camera raw defaults applied to it, except whatever small change you want to be the new default.

  • When will Photoshop CC be able to read FujiFilm's new FinePix S1 RAF (RAW) files?

    Fuji's FinePix S1 was only released a couple months ago.  Don't confuse this with the 14-year-old Fuji S1-Pro.
    As of April 24, 2014, the latest RAW conversion table does not include the FinePix S1 which means that I have to use their rather awkward SilkyPix RAW file converter to make TIFF files before opening them in Photoshop or Lightroom.
    Any ideas of when Adobe will recognize this new RAW format?

    This is a user to user Forum, so you are not really addressing Adobe here, even though some Adobe employees thankfully have been dropping by.
    But this is not the Camera Raw Forum.
    Furthermore: Have you contacted Sony as to what their reasons are for not using DNG or working with Adobe to make their new RAW Formats usable in ACR in time?
    (Camera makers’ preferring their proprietary software for RAW conversions may be perfectly legitimate if the results are superior to Adobe’s, but is that always the case?)

  • How to read UNICODE text file

    Dear Guru,
    Are there any function module that we can use to upload/read UNICODE text file?
    Please advice.
    Regards,
    Ari

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = filenam
        filetype                = 'ASC'
        has_field_separator     = 'X'
      TABLES
        data_tab                = in_rec
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.

  • Read binary file and convert to readable text

    I have a binary file which i want to read in and then convert it into readable text. How can i do this?

    I have a binary file which i want to read in and then
    convert it into readable text. How can i do this?Your question is a bit too vague to be answered. Here's an example -- suppose a file contains the bitstream 11011110101011011011111011101111. (just four bytes full of bits). If one 'converts' this bit stream using four byte big-endian integral values into a hexadecimal representation, the outcome would be 'deadbeef'. Using a little endian conversion, the outcome would be 'efbeadde'. All three text strings you're reading right now (the binary one, and both hexadecimal versions) are readable representations of the actual bitstream ... which one do you want?
    OTOH, if you want to know what's stored in a .class file (this is a Java forum isn't it?), have a look at 'pjava'; it comes with your SDK.
    kind regards,
    Jos

  • Reading unicode text file

    I could not find a VI to read unicode text files - this one reads unicode on the assumption that it contains plain text.  Might help someone struggling with unicode text files produced by some applications.  Enhancements welcome.
    James T

    Possible.  You just want to be able to read them? see attached image. Well for windows anyway.
    Message Edited by Stradis on 08-23-2007 01:07 AM
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?
    Attachments:
    Example_BD.png ‏10 KB

  • Reading n Wrinting files encoding in ANSI or unicode

    I have tried to using DataInputStream to read file the source is below:
    DataInputStream reader = new DataInputStream (
    new FileInputStream (path));
    String line = "";
    char ch = "";
    while ((int)ch != -1)
    ch = reader.readChar ();
    System.out.println ("Char: "+ch);
    //Close the BufferReader object
    reader.close();
    }catch (FileNotFoundException e) {
    System.err.println("READING1: "+e);
    catch (IOException e) {
    System.err.println("READING2: "+e+"\tpath: "+path);
    I need the thing read from the file to be in exactly like the one from the file, which encoding is unicode or ANSI.
    Also, I need to write into a file but I am not able to write a with an new line. Below is my source:
    public void writeFile (String path, String in) {
    try {
    DataOutputStream writer = new DataOutputStream (
         new FileOutputStream (
    path, true));
    //SP4.2.1.4.5.2.1 Write to file
    //Write input into the file
    writer.writeChars (in);
    //Write new line
    writer.writeChar ((char)0x0d);
    writer.writeChar ((char)0x0a);
    writer.flush ();
    writer.close();
    } catch (FileNotFoundException e) {System.err.printl(e);}
    catch (IOException e) {System.err.println(e);}
    }

    Hi,
    you want to read and decode data from a file - why do you use readChar then? - readChar does exactly what it says - it reads a character without decoding it. To read modified UTF-8 you can use readUTF() - this method will decode the modified UTF-8 used by Java to write out Unicode.
    There are examples in the documentation and the tutorial, I guess - give yourself a break and read this first. Certainly you can study the way the text is encoded too and write your own class(es), that can read and write this - it's a good way to learn how this kind of stuff works - not only dealing with "ready to use"-classes is, what makes a good programer, who really understands what he is doing - not only give a class a try and the crying for help if it will not do the work.
    greetings Marsian

  • Adobe X PDF files converted to jpg, edited and converted back to PDF have ragged, unclear text.  I didn't have this problem with Acrobat 9 standard.  What is the remedy for this.  If this is the best I can expect, I won't be able to use X standard.

    Adobe X PDF files converted to jpg, edited and converted back to PDF have ragged, unclear text.  I didn't have this problem with Acrobat 9 standard.  What is the remedy for this.  If this is the best I can expect, I won't be able to use X standard.

    I can't imagine any worse workflow than converting to JPEG to edit text, then back to PDF. Text in a PDF is a vector thing, smooth at all resolutions. And JPEG is made for photos. EVERY conversion to JPEG and back loses quality but how much loss there is will vary.
    If you must go to an image format, try PNG.

Maybe you are looking for

  • Digital Signature in XML Report

    Hi Friends, In Oracle EBS R12, I have a custom XML report developed and running fine. There is a requirement to add the feature of Digital Signature in the output of this report. Please help me with the detailed steps to achieve this. PS: I have trie

  • Probably a stupid question but here goes....

    Hello all, Interested in Airport Time Capsule for backing up my iMac and MacBook and MacBook Pro. Can this product replace the current wireless router? As in I currently have an orange livebox for my broadband and can I get rid of this and use this a

  • Validation between line items in a Document

    Dear Experts I have created a Validation to restrict the Users not to select two different Company Codes in the line item level for a particular Document Type.  The Validation is as shown below: Prerequisite : BKPF-BLART = 'SA' Check : "BSEG-BUKRS1 <

  • Does JNDI always return the same DataSource reference for a connection pool

    Hi, In my project, I have a class called DBConnect which has a method called getConnection(). This method returns a data base Connection object from the pool. I am doing this to avoid replicating code. Here, each time a database connection is require

  • Usage Policy Login Agreement

    I'm trying to figure out how to force users to click on OK to agree to a computer usage policy when logging into out Tiger and Snow Leopard Macs.  This is not available, unfortunately, through Workgroup Manager for these versions of OS X.  I've looke