Results 1 to 14 of 14

Thread: appending an entire file..

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Posts
    70

    Exclamation

    Hello,
    Does anyone know a way to append an ENTIRE file to another without having to open it and cycle through each and every character and appending them?
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    hmmm..

    without having to open it and cycle through each and every character and appending them?
    What the hell do you want man
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Addicted Member Shrog's Avatar
    Join Date
    Aug 1999
    Location
    Darkest Africa
    Posts
    186

    Question Why not?

    This may sound like a silly question, but why don't you like the idea of loading the file into a string?

    As far as I know, a string can hold up to 2 Gigs of data. That can handle a very large file. And even if the file is bigger than that, why not just split it up into two or more parts (read only half the file at a time).

    I cannot imagine a user waiting for a 2Gig file to be read and written byte by byte.

    Just askin'
    Shrog

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    You may want to look at this thread for more info about reading very large textfiles

    http://forums.vb-world.net/showthrea...threadid=34646
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  5. #5
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Just curious

    Not sure if this is possible, but surely someone knows. From VB, could you execute the DOS "COPY" command to copy 2 files into a third file? That would append the two files together.

    In DOS: COPY c:\file1.txt + c:\file2.txt c:\file3.txt




  6. #6
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    If anyone is interested

    I did some searching around, and you can Shell the DOS Copy command to copy 2 files into a third file.

    Code:
    Private Sub Command1_Click()
        Shell ("command.com /c  copy c:\file1.txt + c:\file2.txt c:\file3.txt")
    End Sub
    So, you could use this to append 2 files together without having to open them in VB.

  7. #7
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Jop:
    HeSaidJoe, you're code is somewhat sloppy (in hurry? tired?
    All of the above, but # is not a requirement.
    If you tested my code you know it works with or without #
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    hehe sorry, I didn't knew that...

    But try to be consequent, use either FreeFile OR #1.
    Use either #intNum OR intNum

    'cause it's kinda confusing (I'm tired too ya know )

    Bye.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  9. #9
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hehe, you forgot one thing though, you used Get #1 not Get #intnum

    The compromise between byte by byte and whole file is of course reading in chunks
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  10. #10
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    kedaman:
    Smart A__ LOL
    Later, going to get someone to slap me and wake me up!
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hehe, i'm used to be attacked myself for that kinds of trivial stuff, especially when it gets as late as 6:00am or so
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  12. #12
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Hey that's what I said hehe

    My post wasn't meant as an attack, just a correction.

    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  13. #13
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Were just like immitating the Dennis-Wrenn style

    That means Smart Ass time!
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  14. #14
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    hmm... haven't seen him in a while... DENNIS COME BACK!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width