fixed file format and random-access files

fixed file format and random-access files

Post by Myriam M Abrams » Fri, 10 Jul 1998 04:00:00



Hi!

How do I transform a flat file into a fixed file format so
that I could randomly access it?  Any other hints on randomly
accessing a file would be also appreciated.

Thanks and sorry for the ignorance,

--
                                          myriam

 
 
 

fixed file format and random-access files

Post by A.van.Kesse » Fri, 10 Jul 1998 04:00:00



Quote:

>Hi!

>How do I transform a flat file into a fixed file format so
>that I could randomly access it?  Any other hints on randomly
>accessing a file would be also appreciated.

>Thanks and sorry for the ignorance,

>--
>                                          myriam

The simplest way would be to pad each line upto a constant size (with spaces)
You'll have to determine the max line size first, and the file get a bit
inflated with spaces.

Another way would be to remember the offsets of the beginnings of the lines,
you could do this in a array, or in a (seperate) file. (It would be *very*
handy to mmap() this file ...)

--
Happy hacking,

Adriaan van Kessel.
Ingres DBA, C/Unix hacker

(remove NotThere. from the address in the header)
*** Nederlandstalige zachtwaar is een pijn in de aars ***

 
 
 

fixed file format and random-access files

Post by Dan A. Merc » Fri, 10 Jul 1998 04:00:00



: Hi!

: How do I transform a flat file into a fixed file format so
: that I could randomly access it?  Any other hints on randomly
: accessing a file would be also appreciated.

: Thanks and sorry for the ignorance,

: --
:                                           myriam

Use dd:

dd cbs=80 if=infile of=outfile conv=block

--
Dan Mercer

Opinions expressed herein are my own and may not represent those of my employer.

 
 
 

fixed file format and random-access files

Post by Richard Levenber » Fri, 10 Jul 1998 04:00:00



Quote:> How do I transform a flat file into a fixed file format so
> that I could randomly access it?  Any other hints on randomly
> accessing a file would be also appreciated.

I am not sure if this helps but I have a keyed file. I search for the
key based on a hash of one of the entries and read up until the next
key.

If this is not applicable, please ignore

richardl

 
 
 

1. gdb: core file not in executable format: File format not recognized

We have been having problems recently getting a copy of gdb 4.17 to work
under solaris 2.4 on a sparc20.  Using gcc 2.7.2.3, which seems to compile
correctly, and copies of gdb both built from source and also a prebuilt
binary downloaded from Sunfreeware.com, I am unable to read any core file.  
The message I always get is:

core: not in executable format: File format not recognized

I am beginning to think that the problem lies not with the build of gdb,
but more with the configuration of gcc.  Can anyone help me?  I have run
out of ideas about the cause of this.....

thanks

Lindsay Jack


Dept. of Elec. and Elec. Eng.,  tel : +44 (0)141 548 2205 (direct line)  
University of Strathclyde,      fax : +44 (0)141 552 2487 Glasgow G1 1XQ,
Scotland, U.K.

2. Hard Drive Space

3. Convert vc file format to Lotus 1-2-3 file format?

4. Keyboard Problem in Netscape 3.01

5. File corruption accessing files on a large-file-enabled fs using RM-Cobol

6. Good book for network administrator

7. poor random file access performance

8. Disk Striping Solutions

9. Random access file to struct using scanf

10. process using .so files created with different file format

11. File Format of Snoops Capture File

12. Freeware for constructing IGES files (a CAD file format)

13. file formatting w/"horrible" files.