SECURE way to copy parts of a file

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I need a SECURE way to copy parts of a file. I'm having files which contains
a whole bunch of records. In one 'fysical' file I'm having one or more
logical files.

What I need to do is to copy a logical file (a part of the fysical file)
into a new file. But the 'big' problem is: these records contains
bankstatements, so I can't take the risk that there would be a record
missing, or even one little charachter. The copy I make has to be an
identical copy of the part in the the first file. There can't be a return
too much or too less or something like that.

Does anybody knows a method that ensures me that it will really take that
part of the file and nothing less or more?

Some things that maybe can help to find an easier solution: The logical
files always start at the beginning of a record, so it are always full
records I need to copy, and the records of a logical record are always
grouped together (they aren't mixed up).

It's something like this:
FYSICAL FILE:
record 1: header logical file 1
record 2: data logical file 1
record 3: data logical file 1
....
record 2353: data logical file 1
record 2354: trailer logical file 1
record 2355: header logical file 2
record 2356: data logical file 2
....
record 6222: data logical file 2
record 6223: trailer logical file 2
record 6224: header logical file 3
record 6225: data logical file 3
....
record 8500: data logical file 3
record 8501: trailer logical file 3

I should find a secure way that kind of copy's the whole piece in once (from
header until trailer, like for exemple record 2355 until 6223 in on piece).

Anybody can help me with this?

Thanks a lot in advance,

Pieter
 
Hi Pieter,

Does the old method of writing it, and then reading it back and comparing it
help you?

Cor
 
I can use that (and I guess I will), but it's not really a 'nice' way, hehe.
I guess I'm gonna use that to evaluate it, but it would be nice if I'm
having a way that kind of cuts the whole part and pastes it somewhere else,
and than evaluate if it worked fine or not.
 
I am not sure, because a code let say that german S what you probably use in
Belgie also, can maybe give in all other solutions give problems when a
station has a wrong language code.

I think you never are totally sure, but I can get nothing better than what I
told you what I would do.

Although thinking it over it would be better to avoid all for us "strange"
characters (but even the Euro character is).

I think that it can always be readed on another way on an other station than
you did write it when the language code is different.

But I have no solution for you for that else than keeping it with the 7 bit
ASCII code but that is to less I gues.

I show it I send you the name of my wife, I think that it will be on your
computer a strange name.

Grazyna.

It has to be Grazyna with a dot on the z.

Cor
 
Hm, the test with the name of your wife didn't work, maybe you can send your
wife herself so I can redo the test ;-)

There aren't any 'strange' characters in the files: no euro symbol, etc.

But what I actually need is to be able to say: give me the part of that
message, form that line until that line. And not reading the lines and
concattenating the lines myself.

But I guess there isn't something like that, hehe.

Thanks anyways.
 
DraguVaso said:
Hi,

I need a SECURE way to copy parts of a file. I'm having files which contains
a whole bunch of records. In one 'fysical' file I'm having one or more
logical files.

What I need to do is to copy a logical file (a part of the fysical file)
into a new file. But the 'big' problem is: these records contains
bankstatements, so I can't take the risk that there would be a record
missing, or even one little charachter. The copy I make has to be an
identical copy of the part in the the first file. There can't be a return
too much or too less or something like that.

Does anybody knows a method that ensures me that it will really take that
part of the file and nothing less or more?

Some things that maybe can help to find an easier solution: The logical
files always start at the beginning of a record, so it are always full
records I need to copy, and the records of a logical record are always
grouped together (they aren't mixed up).

It's something like this:
FYSICAL FILE:
record 1: header logical file 1
record 2: data logical file 1
record 3: data logical file 1
...
record 2353: data logical file 1
record 2354: trailer logical file 1
record 2355: header logical file 2
record 2356: data logical file 2
...
record 6222: data logical file 2
record 6223: trailer logical file 2
record 6224: header logical file 3
record 6225: data logical file 3
...
record 8500: data logical file 3
record 8501: trailer logical file 3

I should find a secure way that kind of copy's the whole piece in once (from
header until trailer, like for exemple record 2355 until 6223 in on piece).

Anybody can help me with this?

Thanks a lot in advance,

Pieter
Long time no see kiddies! I think in addition, why don't you look into
useing hash values for the files. .NET can generate MD5 hashes for files,
and if 1 charactor changes, basically, any bit change in the file will
change the hash and make the files not compaire. I replaced all my checksum
systems (CRC, GNU-GPC) with MD5 hashes because it's quick and in the
framework already. I do have a class alread built if you need something to
start with.

HTH
Sueffel
 
Back
Top