| View previous topic :: View next topic |
| Author |
Message |
DW Contributor

Joined: 21 Mar 2003 Posts: 175 Location: UK
|
Posted: Fri Apr 04, 2003 7:53 pm Post subject: File data help |
|
|
Hi,
I can some one show me how to make a little script that will take any file, open the data up in a list (not visable) and then write all the data back to the file but with a different name?
thank you, i tried with binfile but it corrupts. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Apr 04, 2003 7:58 pm Post subject: |
|
|
This will open an ASCII-based file and save it. But it you are not going to
process it or anything you might as well just use FILE COPY,file1,file2
| Code: | %%file = C:\test.dat
%%output = C:\test2.dat
list create, 1
list loadtext, 1, %%file
list savefile, 1, %%output
list close, 1 |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
DW Contributor

Joined: 21 Mar 2003 Posts: 175 Location: UK
|
Posted: Fri Apr 04, 2003 8:01 pm Post subject: |
|
|
| I play to do things with the file but i am trying to learn so i dont want you to give me all the code just help with the bits i get lost in. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Apr 04, 2003 8:03 pm Post subject: |
|
|
Well the code I gave should open all types of files except binary-type
files.
Otherwise you would need to use BINFILE and I am still figuring that out. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
DW Contributor

Joined: 21 Mar 2003 Posts: 175 Location: UK
|
Posted: Fri Apr 04, 2003 8:05 pm Post subject: |
|
|
That was my next question, what about bin files?
how can i do those too?
i need to be able to do it with all file types. |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Apr 05, 2003 8:39 am Post subject: |
|
|
| For binary files you can use the binfile command... |
|
| Back to top |
|
 |
DW Contributor

Joined: 21 Mar 2003 Posts: 175 Location: UK
|
Posted: Sat Apr 05, 2003 10:00 am Post subject: |
|
|
thats a good answer. I know i can use it but the really question is how?
just like freezingfire, im still getting to hang of binfile. |
|
| Back to top |
|
 |
nick Contributor

Joined: 15 Aug 2000 Posts: 50 Location: hamburg,nj
|
Posted: Sat Apr 05, 2003 2:11 pm Post subject: |
|
|
Hi:
Just a thought... Why not use the FILE RENAME command. _________________ nick |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Apr 05, 2003 3:20 pm Post subject: |
|
|
I think DW wants to open the file and do some processing and then save
the file to a different name.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
DW Contributor

Joined: 21 Mar 2003 Posts: 175 Location: UK
|
Posted: Mon Apr 07, 2003 4:14 pm Post subject: |
|
|
you got it freezingfire.
i just about have the bin thing under control, almost. |
|
| Back to top |
|
 |
|