Sign in to follow this  
Followers 0
chrisT

Append one text.txt file to another text2.txt file

11 posts in this topic

I have looked, leaving almost no stone unturned, does abody know a simple way, not just to filewriteline or filewrite, but to append an entire text file to another textfile, perhaps ClipPut/ClipGet with a $string variable, sorry I'm very new here, forgive my ignorance. :D

Share this post


Link to post
Share on other sites



I have looked, leaving almost no stone unturned, does abody know a simple way, not just to filewriteline or filewrite, but to append an entire text file to another textfile, perhaps ClipPut/ClipGet with a $string variable, sorry I'm very new here, forgive my ignorance. :D

you could just....

$file1 = FileRead("c:\file1.txt")
$file2 = FileOpen("C:\file2.txt",1)
FileWrite($file2,@CR & $file1)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

you could just....

$file1 = FileRead("c:\file1.txt")
$file2 = FileOpen("C:\file2.txt",1)
FileWrite($file2,@CR & $file1)
cameronsdad Great!! thx for your quick response u make this look easy.....

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

cameronsdad Great!! thx for your quick response u make this look easy.....

no problem man, i'm always glad to help. and it just gets easier and easier as you go along.

***edit***

P.S. Welcome to the forum

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Hi,

I am getting an error message when I used this code , for appending the files. Actually for "FileRead" we need to give one more parameter that is the "count".

I need to append the whole file to another. How can I do this ? Could some one help ?

Vinod

Share this post


Link to post
Share on other sites

Yea certainly. He just wrote some quick apparently psuedo code.

$file1 = FileRead("c:\file1.txt", FileGetSize("c:\file1.txt"))
$file2 = FileOpen("C:\file2.txt",1)
FileWrite($file2,@CR & $file1)
FileClose($file2) ;Note: $file1 should close itself due to only using FileRead()

I hope this further helps you in your Adventures with AutoIt.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Yea certainly. He just wrote some quick apparently psuedo code.

$file1 = FileRead("c:\file1.txt", FileGetSize("c:\file1.txt"))
$file2 = FileOpen("C:\file2.txt",1)
FileWrite($file2,@CR & $file1)
FileClose($file2) ;Note: $file1 should close itself due to only using FileRead()

I hope this further helps you in your Adventures with AutoIt.

JS

actually, my example assumed beta, which has the second parameter as optional with the default value being the entire file. only in 3.1.1 the count is a required parameter. beta is betta'

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

simple way to concatentate files

concatanate foo and bar to foo.bar

copy foo + bar foo.bar

OR

type foo > foo.bar

type bar >> foo.bar

using wildcards is also permitted....

copy *.foo foofiles

"the console is your friend"....


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

actually, my example assumed beta, which has the second parameter as optional with the default value being the entire file. only in 3.1.1 the count is a required parameter. beta is betta'

AutoIt's Beta is definitely better. I didnt know that being an optional param in beta. Thanks for the tip. I'll remember that.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Thanks a lot for all the inputs..

Share this post


Link to post
Share on other sites

AutoIt's Beta is definitely better. I didnt know that being an optional param in beta. Thanks for the tip. I'll remember that.

JS

Thanks a lot for all the inputs..

Always glad to help


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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