mix up a file

I have created a script that will write to a file. Now I want to take that file and mix up all the contents (numbers), is there a way to do this?
boumajlAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mark2150Commented:
There are lots of ways to do this. Are you trying to encrypt the contents of the file? How big is the file? How secure do you need it to be?

M
0
boumajlAuthor Commented:
I am not trying to encrypt the contents of the file, the file contains 50000 records, security is not really an issue.
0
JuiletteCommented:
BOURMAJL: What are you trying to do?
End: Disconnect User: Jumble A File:
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

boumajlAuthor Commented:
jumble a file.
0
Goob123Commented:
Are you wanting to be able unjumble the file as well?
0
mark2150Commented:
So the point of jumbling the file is?

Are you trying to pick random reconds from the file? Or are you trying to garble the entire file?

M
0
AnswerTheManCommented:
don't know what you are after but there is a basic and simple way to do it :

1. in your app :
2. open another new file for inserting
   the jumbled chars.
3. open the file you want to jumble and
   read each charcter (loop).
4. create kinda dictionary in your app
   that will replace every char to
   other one. for instance :
   "A" will be "%"
   "F" will be "P"
   etc...
5. upon reading a char - have a Select
   case routine that will return the
   char to be entered instead a given
   caar according to that dictionary.
6. write the returned char to the new
   file, keep doing so until EOF of
   Source file.
7. kill the Source file.
8. Rename the new file to have the Source(delleted) file name.

NOTE that once someone cracked your dix - he'll be able to reverse evrything you do.
there are better solutions to do it
that prevent it, but they are more complicated. that one is just the basic.


0
JuiletteCommented:
I think someone should look at bourmajl's questions...What is the end result of what Bourmajl is trying to do?
Question 1: End Terminate
Question 2: Disconect user
Question 3: Mix (JUmble a file)

Where is this all leading?
0
AnswerTheManCommented:
-----------------------------
Comment  
 From: Juilette
 Date: Friday, December 03 1999 - 07:16AM PST  
BOURMAJL: What are you trying to do?
End: Disconnect User: Jumble A File:
 
Comment
 From: boumajl
 Date: Friday, December 03 1999 - 09:06AM PST  
jumble a file.
----------------------------

hey, this one have been cleared or we get diffrent pages on this Q.....

0
JuiletteCommented:
AnswerTheMan
look at the post above yours...where are these questions going...look suspicious to you or am I infected with a sever case of caution virus paronia?
0
AnswerTheManCommented:
Juilette :)
the moment you turn on your machine power, especially when starting some outside connection - PARANOIA is acceptable.
However, Those you should really worry about - are those who know too well to 'jumble' a file, and need not ask it here.

(boumajl: don't read this section)
you have nothing to worry about 'boumajl'. YOU, ME and lots of others will know to jumble a file in every language we'll just learn under every OS without needing to ask 'how to do it'. it's not a shame to ask questions, but there are tasks that if you unable to do yourself - you have nothing to look for in this tread.
boumajl won't get far. a "programer" who can't figure out 'how to jumble a file' by himself - does not deserve your fear.




0
boumajlAuthor Commented:
I just have a file, full of 50,000 random numbers, now I want to mix them up in a different way. I don't want them encrypted, I just want them in different places, why is really not an issue.
0
JuiletteCommented:
AnswerTheMan:
Yea..well put!
0
AnswerTheManCommented:
tnx.

boumajl :
if it's only NUMBERS - then the process i offered you is much more simple.
all you have left to do is to TRANSLATE this verbal process into WORKING CODE.
0
runakoCommented:
To mix up the numbers, try something like the following:

1. Read the numbers from the file and add them to a Collection.
2. While Collection.Count > 0
     ' Random_Function generates a random number between 1 and its input
     NumIdx = Random_Function(Collection.Count)
     NextNum = Collection.Item(NumIdx)
     ' Write NextNum to output file
     Collection.Remove(NumIdx)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
boumajlAuthor Commented:
Thank you! finally someone gave me a decent answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.