how to extract data from a EBCDIC file
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a copy of a EBCDIC backup file I need to extract data from. how can I do this? I was told notepad but that did not work
5 commentaires
dpb
le 17 Oct 2018
Modifié(e) : dpb
le 17 Oct 2018
That depends on what you mean by "seeing" the data the way it is in the file...
You can simply
fid=fopen('yourfile'),'r');
f=fread(fid,'*uint8');
fid=fclose(fid);
will give you an array that will show you the content of each byte.
A byte-dump app will let you do this with some formatting of the file by counting bytes and showing ASCII conversion (1:1, unless it has the option for EBCDIC which is rare), but you can then at least explore the file content.
You don't indicate which OS you're using; there's a LIST(*) utility builtin the command processor I use (TakeCommand from JPSoft) on Windows; there are freeware versions out there but I don't have a particular one to recommend and (I think) there are *ix shell tools.
What you really, really need is a description of what the file actually is and a routine to restore it from the system that created it if it is a backup. AS400, maybe???
(*) A sample of what such a utility output looks like; this was a file from a previous user Q? that just happened to be around...it, of course, isn't EBCDIC but just shows how you could poke around in a file to see if can determine what it's content is.
It isn't hard to write a minimalist such a tool; as you see all it is is the address of each record on the left and then the content of the file in hex on the left and the ASCII character representation of the same bytes on the right.
stefan.bin │ F1 Help │ Col
0000 0000 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 ☺.☻.♥.♦.♣.♠.•.◘.
0000 0010 09 00 0a 00 0b 00 0c 00 0d 00 0e 00 0f 00 10 00 ..........♫.☼.►.
0000 0020 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 ◄.↕.‼.¶.§.▬.↨.↑.
0000 0030 19 00 1a 00 1b 00 1c 00 1d 00 1e 00 1f 00 20 00 ↓.→...∟.↔.▲.▼. .
0000 0040 21 00 22 00 23 00 24 00 25 00 26 00 27 00 28 00 !.".#.$.%.&.'.(.
0000 0050 29 00 2a 00 2b 00 2c 00 2d 00 2e 00 2f 00 30 00 ).*.+.,.-.../.0.
0000 0060 31 00 32 00 33 00 34 00 35 00 36 00 37 00 38 00 1.2.3.4.5.6.7.8.
0000 0070 39 00 3a 00 3b 00 3c 00 3d 00 3e 00 3f 00 40 00 9.:.;.<.=.>.?.@.
0000 0080 41 00 42 00 43 00 44 00 45 00 46 00 47 00 48 00 A.B.C.D.E.F.G.H.
0000 0090 49 00 4a 00 4b 00 4c 00 4d 00 4e 00 4f 00 50 00 I.J.K.L.M.N.O.P.
0000 00a0 51 00 52 00 53 00 54 00 55 00 56 00 57 00 58 00 Q.R.S.T.U.V.W.X.
0000 00b0 59 00 5a 00 5b 00 5c 00 5d 00 5e 00 5f 00 60 00 Y.Z.[.\.].^._.`.
0000 00c0 61 00 62 00 63 00 64 00 65 00 66 00 67 00 68 00 a.b.c.d.e.f.g.h.
0000 00d0 69 00 6a 00 6b 00 6c 00 6d 00 6e 00 6f 00 70 00 i.j.k.l.m.n.o.p.
0000 00e0 71 00 72 00 73 00 74 00 75 00 76 00 77 00 78 00 q.r.s.t.u.v.w.x.
0000 00f0 79 00 7a 00 7b 00 7c 00 7d 00 7e 00 7f 00 80 00 y.z.{.|.}.~.⌂.Ç.
0000 0100 81 00 82 00 83 00 84 00 85 00 86 00 87 00 88 00 ü.é.â.ä.à.å.ç.ê.
0000 0110 89 00 8a 00 8b 00 8c 00 8d 00 8e 00 8f 00 90 00 ë.è.ï.î.ì.Ä.Å.É.
0000 0120 91 00 92 00 93 00 94 00 95 00 96 00 97 00 98 00 æ.Æ.ô.ö.ò.û.ù.ÿ.
0000 0130 99 00 9a 00 9b 00 9c 00 9d 00 9e 00 9f 00 a0 00 Ö.Ü.¢.£.¥.₧.ƒ.á.
...
Réponses (0)
Voir également
Catégories
En savoir plus sur File Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!