Sign in to follow this  
Followers 0
t0ddie

file splitting

11 posts in this topic

there is a utility i have called "chop"

http://www.sinnercomputing.com/ChopDL.htm

it will split a file down, into seperate smaller files.

this is great for me because i want to upload the files onto a free webserver

and i have a limit on the size of the files i can upload.

but the problem is that i want to be able to "unchop" (reassemble) the files

after download on a computer that does not have "chop" installed.

im making a script that will download files from the internet

sure i could install chop on the computer that im downloading from, except that its not my program and i dont want to include "chop" with my script so that when the script downloads these files it can "unchop" them.

my question is:

is there a simple way to "chop" and "unchop" files using autoit?

i thought maybe just changing the extention to .txt and reading in lines of the file and just splitting them at 100 lines or so each. then later combining the .txt files into one file and changing the extention back to its original extention.

will this work??? or is there a better way...

THANKS!

~that drunk annoying guy from the forums


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



If you use chop method BAT, the resulting files are assembled using the DOS copy command in a BAT file:

Copy /b file0001.chp+file0002.chp "file.zip"

It should be no trouble to either execute the BAT file from your script or code the copy command.

Share this post


Link to post
Share on other sites

If you use chop method BAT, the resulting files are assembled using the DOS copy command in a BAT file: 

Copy /b file0001.chp+file0002.chp "file.zip"

It should be no trouble to either execute the BAT file from your script or code the copy command.

<{POST_SNAPBACK}>

i was just noticing that option as i just got this proram (chop)

cool.

but i was wondering, would my method work? im going to try it now!


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

ok now i really need help. lol

i dont get it.. i change the file to .txt then back to .exe and it runs fine.

but...

i copy the text in notepad and paste it in a new file and change it to .exe and it wont run.

and the worst part is that i cant delete the file now! it says tis being used by another person or program, and i looked in the processes and its not.. also i cant delete it on next boot i tried! even with RunOnce in the registry!

i have a feeling the reason its not working is because my ascii character map isnt complete (ive heard you can have more than what i have)

and those squares that i see in the text file are unknown characters. so its not copying them.

so how do i get rid of these files now!!!!

and copy and paste isnt doing the job, but will filereadline and filewriteline be any better?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

ok now i really need help. lol

i dont get it.. i change the file to .txt then back to .exe and it runs fine.

but...

i copy the text in notepad and paste it in a new file and change it to .exe and it wont run.

and the worst part is that i cant delete the file now! it says tis being used by another person or program, and i looked in the processes and its not.. also i cant delete it on next boot i tried! even with RunOnce in the registry!

i have a feeling the reason its not working is because my ascii character map isnt complete (ive heard you can have more than what i have)

and those squares that i see in the text file are unknown characters. so its not copying them.

so how do i get rid of these files now!!!!

and copy and paste isnt doing the job, but will filereadline and filewriteline be any better?

<{POST_SNAPBACK}>

Why use copy and paste?

just use the dos copy command to append the one file to the other as said by Jason_A.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

ok thats IF i use chop. maybe ill use it if all else fails...

im trying to use my OWN method here without using a 3rd party program.

and i could test myself whether it will work with filereadline and filewriteline, and if it doesnt work then ill just come back and probably ask some other question.

but for right now....

HOW THE HELL... can i erase these damn files! (the files that i tinkered with.. read last post)

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

what also sucks, is im able to move the file once (i dragged onto my desktop)

but i try to move it again and i get the ERROR (waaaaa!)

so i can move it once, but not twice?!

and i could not delete it from the start because it says its in use by another program.... but i can move it? and only once???

so now i got like 4 damn files that i cant even rename, delete or move sitting on my desktop.

its olmost like a damn virus (lol) not being able to tamper with these files is kind of cool, if i could impliment it in a WORKING script. but this isnt something i tried to do, and the program doesnt work when i use this "method" on it (.exe to .txt to .exe) and its rather annoying.

ill check back later


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Handle can tell you what process has hold of a particular file.

http://www.sysinternals.com/Utilities/Handle.html

Or, maybe the filename is messed up, in which case you could use DirectoryFixer

http://www.somacon.com/p132.php

In any case, I would not advise using Notepad to do anything with an EXE file. Notepad really only knows ASCII... and I don't think it has anything to do with your character map being incomplete. A hex editor might work, (XVI32 is free and has a simple built-in scripting language: http://www.chmaas.handshake.de) but that's still an external program.

Sorry, I'm no help on whether you can do it with only AutoIt.

Edited by Jason_A

Share this post


Link to post
Share on other sites

If they are text files...just do file length, FileRead the first half or so of the file, and then FileRead the second half of the file into the 'chops', and then just put them back together based upon filename...


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

right fanboy.

thats what i was going to do. my only question is whether the data is all going to be there when i read the .txt file

after changing a .exe to a .txt then back to .exe it runs like i said

but if i copy and paste the data from the .txt file into a blank .txt file

and try to run that, i get the error.

and i dunno if i dont have admin rights on this computer im on, but i run that handle program and it flashes a screen for about 2 seconds then dissappears.

maybe thats what happens if you dont have admin right? or im using it wrong...

i dont care! its stupid that i cant delete these files!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I believe that the problem lies in the fact that windows takes notice of the difference between text-based and binary file formats...

Take a look at Larry's _APIFileRead() and _APIFileWrite() functions for the beta...

Edited by MSLx Fanboy

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0