English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

suppose i have a file of size 2000kb. can i delete about 1000kb and keep the remaining 1000kb ?if i can how to delete?

2006-10-06 22:28:40 · 4 answers · asked by suriah s 1 in Computers & Internet Programming & Design

4 answers

Open it up in note pad and Remove a chunk of it.

2006-10-06 22:31:03 · answer #1 · answered by god0fgod 5 · 1 0

Of course. Exactly how you accomplish this is very much relative to the programming language you are using. In general, you have two ways of opening a file: cooked mode or raw. This determines whether or not the file is read as a series of bytes or a series of characters. This might make a difference to your program. Probably to do what you describe, you'd have to open the file, read or seek to the 1k byte point, open a second file, and copy the remainig date onto the new file. Once you'd saved it, you'd delete the original file, and rename the new one to be the same as the original one.

2006-10-06 22:35:48 · answer #2 · answered by Gizmo L 4 · 0 0

there is many option for this. (as mentioned earlier)
tho u hav option to do it with ur own program. It is really easy to handle files in c.
let the file u wanna concatanate has name "a.txt"
follows the c program which will delete 1000 bytes from the file and leaving rest as it is
#include
void main()
{
int i=0;
char ch;
FILE *ft,*f = foepn("a.txt","a+");
ft = fopen("temp.txt","a+");
while(!feof(f))
{
i++;
if(i>1000)
{
fscanf(f,"%d",&ch);
fprintf(ft,"%c",ch);
}
if(feof(f))
break;
}
unlink(f);
f = fopen("a.txt","a+");
while(!feof(ft))
{
fscanf(ft,"%c",&ch);
fprintff,"%c",ch);
}
unlink(ft);
}


this will do exactly what u are willing to do

}

2006-10-06 23:14:12 · answer #3 · answered by neo 2 · 0 0

Of couse you can. but firstable you need some programs to help you to seprate it. Please note you have to make sure it is legal according to the Copyright law.

2006-10-06 22:37:00 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers