Re: file encoding prob.




"Dan Espen" <daneNO@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le message de
news: ic1wnotieg.fsf@xxxxxxxxxxxxxxxxxxx
igthibau@xxxxxxxxxx writes:

Dan Espen wrote:

igthibau@xxxxxxxxxx writes:

Hi there,
Right, I wrote a fortran code that reads text files and produces
output.
The problem is that the files I created to test the code work fine. But
files I get from "outside", even if as ascii contain control codes that
screw things up.

Things like ^@^M and such.

dos2unix does nothing.

So, the big question is : how does one strip files from these codes, or
change them to linux standards?

This is the one thing that prevents the process to work and I am
running
out of ideas here.

First be more exact in your problem description.
The "and such" part is throwing me off.

well they are the codes I see : ^X , where X=F or @ or M or D...


If you see the above symbols, you'd have to tell use which program
showed them.

gvim, vi

Better to run "od -x" and tell us if it's line endings
only or something else.
they occur within text : sample : (the numbers are line no.)

49 ^B^@^@^@er ^B^@^@^@er
50 ce ce
51 ^F^@^@^@lenge ^F^@^@^@lenge
52 réservé réservé

A little.

It doesn't look like any fortran I've ever seen.
I'm not sure vi is a good vehicle for viewing actual
file contents. I'd trust xemacs more.
Are you sure the data you want is there?

^@ is usually NULL you can remove NULLs with sed.
something like:

s/\000//


It isn't fortran, it is the result of a text file (html in fact) that is
being read by a fortran prog (I don't think the language matters here, but
maybe).
As for the date being there, well it is anything that is not those control
codes.
And I don't understand why these codes appear.

lost.

G



.



Relevant Pages

  • Re: thoughts on dynamic from a beginners perspective
    ... working engineering and heavy duty numerical codes from Fortran to ... writing such codes today. ... Interoperating between managed languages makes it trivial to ...
    (comp.programming)
  • Re: MSPF/CVF/CVF DLL calling a LF90/LF95 DLL?
    ... which it blithely assumes has been sent using the calling ... > conventions etc. it understands. ... > only works from C, or from Fortran, or whatever. ... sources of errors in f77 codes and were occasionally very tricky to ...
    (comp.lang.fortran)
  • Re: file encoding prob.
    ... The problem is that the files I created to test the code work fine. ... how does one strip files from these codes, or ... It doesn't look like any fortran I've ever seen. ... then use "sed" to remove the control codes ...
    (comp.os.linux.misc)
  • Re: declarations summary
    ... Well, many scientists and engineers don't have the time, motivation or ... ability to master the intricacies of recent fortran vintages either. ... Toy codes will probably move from Matlab to Python soon enough, ...
    (comp.lang.python)
  • Re: c-gateways, fortran-sources, VC 6 - how to?
    ... > I am trying to link my fortran codes to matlab. ... I didn't figure out how to compile ...
    (comp.soft-sys.matlab)