471,853 Members | 860 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

SECURE way to copy parts of a file

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
Nov 20 '05 #1
5 1786
Cor
Hi Pieter,

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

Cor
Nov 20 '05 #2
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.

"Cor" <no*@non.com> wrote in message
news:OQ**************@TK2MSFTNGP11.phx.gbl...
Hi Pieter,

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

Cor

Nov 20 '05 #3
Cor
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
Nov 20 '05 #4
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.

"Cor" <no*@non.com> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #5

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:40*********************@news.skynet.be...
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
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Boris Genc | last post: by
68 posts views Thread by Roman Ziak | last post: by
2 posts views Thread by Mullin Yu | last post: by
4 posts views Thread by jack | last post: by
14 posts views Thread by Usman | last post: by
1 post views Thread by Todd Sparks | last post: by
19 posts views Thread by Khafancoder | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.