Subject Re: I can\'t open this .dat file
From Mervyn Bick <invalid@invalid.invalid>
Date Tue, 20 Mar 2018 17:00:09 +0200
Newsgroups dbase.getting-started
Attachment(s) articl.txtarticl.prg

On 2018-03-20 3:26 PM, Mervyn Bick wrote:

> I had a look inside the files using a HEX editor and I'm afraid the .DAT
> file, which is 104 bytes long, contain 101 null characters.  The first 3
> bytes are the hex values C2 D0 07.  Whatever they represent, it's not
> ASCII characters.

Oops. That was the .DAI file that was attached to your second message.
The .DAT file attached to your first message had a fair bit of text
tucked away between all the nulls.

The attached file, articl.txt, contains all the printable characters in
articl.dat.  It looks as if 8D is used as a line break.  There are a
couple of the more usual 0D (carriage return) and 0A (line feed)
characters scattered about but no 0D0A (CRLF) anywhere.  I've forced a
CRLF for every 8D, 0D or 0A but even so there is quite a lot of
unformatted text.

The unformatted text at the top could perhaps be field information but I
couldn't even begin to guess what the unformatted text at the bottom
represents.

For what it's worth, the little "quick and dirty" program I used to get
rid of the non-printable characters is attached so you can have a look
at some of the other .DAT files.

If you can work out which data belongs in which fields it will be
possible to turn this into a .csv file which can be loaded by dBASE or
Excel.

Mervyn



!
q8AJUSTEMENT TTC  AJUSTEMENT                              AJUSTEMENT TTCAJUS
Ajustementm313EUR0000000000000000758100000000000000000008POT 6.25M       POTEAUX 6M25 FRANCE TELECOM             POT 6.25MRPOTPoteaux 6m25 France Tlcom6,25P,101m330FRFFBI00000000000000008POT 7M          POTEAUX 7 M FRANCE TELECOM              POT 7MRPOTPoteaux 7 m France Tlcom7p,138m369FRFFBI00000000000000008POT 8M          POTEAUX 8 M FRANCE TELECOM              POT 8MRPOTPoteaux 8 m France Tlcom8p,165m383FRFFBI0000000000000000

hF8S140  9M        POTEAUX EDF                             S140  9MRPOTPoteaux EDFS 1409p,260m391FRFFBI0000000000000000
XH8S190  9M        POTEAUX EDF                             S190  9MRPOTPoteaux EDFS 1909p,305m3107FRFFBI0000000000000000
xH8S255  9M        POTEAUX EDF                             S255  9MRPOTPoteaux EDFS 2559p,350m3123FRFFBI0000000000000000
hH8S325  9M        POTEAUX EDF                             S325  9MRPOTPoteaux EDFS 3259p,420m3147FRFFBI0000000000000000
J8S140  10M       POTEAUX EDF                             S140  10MRPOTPoteaux EDFS 14010p,305m3107FRFFBI0000000000000000
J8S140  11M       POTEAUX EDF                             S140  11MRPOTPOTEAUX EDFS 14011p0,305m3173,00FRFFBI0000000000000000

G8S140  12M       POTEAUX EDF                             S140  12MRPOTPOTEAUX EDFS 14012p0,395m3198FRFFBI0000000000000000
F8S140  13M       POTEAUX EDF                             S140  13MRPOTPOTEAUX EDFS 14013p0,490m3245FRFFBI0000000000000000
F8S140  14M       POTEAUX EDF                             S140  14MRPOTPOTEAUX EDFS 14014p0,550m3275FRFFBI0000000000000000
F8S190  10M       POTEAUX EDF                             S190  10MRPOTPOTEAUX EDFS 19010p0,350m3123FRFFBI0000000000000000
xF8S190  11M       POTEAUX EDF                             S190  11MRPOTPOTEAUX EDFS 19011p0,400m3200FRFFBI0000000000000000
F8S190  12M       POTEAUX EDF                             S190  12MRPOTPOTEAUX EDFS 19012p0,460m3230FRFFBI0000000000000000
G8S190  13M       POTEAUX EDF                             S190  13MRPOTPOTEAUX EDFS 19013p0,560m3280FRFFBI0000000000000000
0G8S190  14M       POTEAUX EDF                             S190  14MRPOTPOTEAUX EDFS 19014p0,625m3313FRFFBI0000000000000000
G8S190  15M       POTEAUX EDF                             S190  15MRPOTPOTEAUX EDFS 19015p0,690m3345FRFFBI0000000000000000
F8S255  10M       POTEAUX EDF                             S255  10MRPOTPOTEAUX EDFS 25510p0,405m3142FRFFBI0000000000000000
0G8S255  11M       POTEAUX EDF                             S255  11MRPOTPOTEAUX EDFS 25511p0,465m3233FRFFBI0000000000000000
xG8S255  12M       POTEAUX EDF                             S255  12MRPOTPOTEAUX EDFS 25512p0,535m3268FRFFBI0000000000000000
G8S255  13M       POTEAUX EDF                             S255  13MRPOTPOTEAUX EDFS 25513p0,640m3320FRFFBI0000000000000000
hG8S255  14M       POTEAUX EDF                             S255  14MRPOTPOTEAUX EDFS 25514p0,710m3355FRFFBI0000000000000000
G8S325  10M       POTEAUX EDF                             S325  10MRPOTPOTEAUX EDFS 32510p0,480m3168FRFFBI0000000000000000
G8S325  11M       POTEAUX EDF                             S325  11MRPOTPOTEAUX EDFS 32511p0,550m3275FRFFBI0000000000000000
F8S325  12M       POTEAUX EDF                             S325  12MRPOTPOTEAUX EDFS 32512p0,630m3315FRFFBI0000000000000000
`G8S325  13M       POTEAUX EDF                             S325  13MRPOTPOTEAUX EDFS 32513p0,745m3373FRFFBI0000000000000000
8G8S325  14M       POTEAUX EDF                             S325  14MRPOTPOTEAUX EDFS 32514p0,830m3415FRFFBI0000000000000000
G8S325  15M       POTEAUX EDF                             S325  15MRPOTPOTEAUX EDFS 32515p0,915m3458FRFFBI0000000000000000
F8SCIURE M3       SCIURE RESINEUX                         SCIURE M3RSCISCIURE RESINEUXRm3v0,278TN12,50EUREO2
xM8ECORCES M3      ECORCES RESINEUX                        
ECORCES M3VRECECORCES RESINEUXm3v0,278TN2,58EURSICAR8PLAQ.FOREST M3  PLAQUETTES FORESTIERES RESINEUX         PLAQ.FOREST M3RPFPLAQUETTES FORESTIERES RESINEUXm3v0,278TN5,50EURSICAR8EUREO2

fIn = new file()
fIn.open('articl.dat')
fOut = new file()
fOut.create('articl.txt')
do while not fIn.eof()
   cread = asc(fIn.read(1))
   if (cRead >= 32 and cRead <= 255) or cRead = 10 or cRead = 13
      fOut.write(chr(cRead))
      if cRead = 141 or cread = 10 or cread = 13
         fOut.write(chr(13)+chr(10))
      endif  
   endif
enddo
fIn.close()
fOut.close()