Re: recommendation for dealing with legacy data




"Jeff Kish" <jeff.kish@xxxxxxx> wrote in message news:nlb252pl5pblr7kklm3ngn9sfkgpoa35in@xxxxxxxxxx
Greetings.

I am not too awfully advanced when it comes to java programming, but I have
done a fair amount of c/c++.

I have some legacy data files which are fixed length binary.
I'd like to figure out the best way to read the files from a java program that
may be running on any variety of platforms, and subsequently process the data.

The data fields in each record in the file may have '\n', nulls or any other
data.

Can someone recommend the best way, or even a good way to go about reading
this file and taking the 1st n bytes and processing it etc. I'll need to
find/recognize/skip '\n' etc.

The datafiles will always have come from a Wintel machine, using probably the
default western character set whatever the heck that is.

Any gotchas/watch out fors/etc would be appreciated.

There are too many "ors" and "etcs." here for me to make much sense of the nature of your files. If it's arbitrary binary data, what's wrong with using java.io.FileInputStream to turn your file into a stream of bytes, and working from there?

I don't understand what you mean by "I'll need to find/recognize/skip '\n' etc." Why would the '\n' character be treated specially in arbitrary binary data? It's fixed length, so surely this character isn't acting as a seperator, right?

- Oliver

.



Relevant Pages

  • Re: Binary to ASCII Question
    ... convert the binary data of a JPEG file to a character stream? ... If you really use the String constructor, ... encoding of the JVM running may require a conversion. ... Java programming tips: http://jiu.sourceforge.net/javatips.html ...
    (comp.lang.java.programmer)
  • Re: Possible bug in Calendar
    ... Arne Vajhøj wrote: ... claim and you don't have the character to admit it ... This newsgroup is supposed to be about Java programming, not about who is or isn't a liar, a nincompoop, or whatever-else. ...
    (comp.lang.java.programmer)
  • Can we do this with println?
    ... I am new to Java programming. ... In the diagram above as 'X' is any character and the remaining one is ... _not_ a homework but something I am trying to do nevertheless. ...
    (comp.lang.java.programmer)
  • Re: Feeding the Trolls
    ... Patricia Shanahan wrote: ... Java programming, while allowing those who want to continue the thread ... We just need to see if the "main character" wants to ... follow or instead will find new "innocent threads" ...
    (comp.lang.java.programmer)