Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Help rewriting some code - create a file list and write it to a text file

  1. #1
    I could stop if I wanted to aaronic_abacus's Avatar
    Join Date
    2006-04
    Posts
    432
    Login to Give a bone
    0

    Default Help rewriting some code - create a file list and write it to a text file

    I wrote this program and lost the code.
    I am hoping maybe some of you guys more versed in Visual Basic would do it with ease.
    Attached is the EXE. It just needs to make a file list and write it to a text file.
    For the current program to function, LOOKDB.LDB must be in C:\Wat
    Attached Files Attached Files

    http://www.watsonlisp.com

    Artificial Intelligence for AutoCAD
    Find detail drawings by text and attribute content!
    6000 lines of code and and in development since 1997.
    Say goodbye to detail books.

  2. #2
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    I don't see no code there
    just a list of files:

    C:\acad stuff\zip8\CLNOUT.dwg
    C:\acad stuff\zip8\CTCHBSN.dwg
    C:\acad stuff\zip8\CURBGUT.dwg
    C:\acad stuff\zip8\CURBGUT2.dwg
    C:\acad stuff\civildetails\51-104.dwg
    C:\acad stuff\civildetails\51-105.dwg
    C:\acad stuff\civildetails\51-11.dwg
    C:\acad stuff\civildetails\51-112.dwg

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  3. #3
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    Okay, here is slightly adapted
    listing by Ken Puls
    Code:
    Option Explicit
    
    '' based on listing written by Ken Puls (www.exelguru.ca)
    
    Sub TextStreamTest()
        Const ForReading = 1, ForWriting = 2, ForAppending = 3
        Dim fso As Object
        Dim fdw As Object, sdw As Object
        Dim fdr As Object, sdr As Object
        Dim strText As String
         
         'create file sysytem object
        Set fso = CreateObject("Scripting.FileSystemObject")
        
         'get file to read and open text stream
        Set fdr = fso.GetFile("C:\Wat\Lookdb.ldb")
        Set sdr = fdr.OpenAsTextStream(ForReading, False)
         
         'create new file to write to
        fso.CreateTextFile ("C:\Wat\Lookdb.txt")
        Set fdw = fso.GetFile("C:\Wat\Lookdb.txt")
        Set sdw = fdw.OpenAsTextStream(ForAppending, False)
         
         'iterate through the end of first file
        Do Until sdr.AtEndOfStream
            'read string from the first file
            strText = sdr.ReadLine & vbNewLine '<--added carriage return to jump on the next line
            'write to the second one
            sdw.Write strText
        Loop
         
        'close both files and clean up
        sdr.Close
        sdw.Close
        Set sdr = Nothing
        Set sdw = Nothing
        Set fdr = Nothing
        Set fdw = Nothing
        Set fso = Nothing
    
    End Sub
    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  4. #4
    I could stop if I wanted to aaronic_abacus's Avatar
    Join Date
    2006-04
    Posts
    432
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    When I originally created the code I used some projects found on vbcode.com and spliced them together. Basically I was hoping you guys could use LOOKDB.EXE to recreate the code. I need the recreated code so I can create READDB.EXE to select multiple text documents. I need a complete project.

    http://www.watsonlisp.com

    Artificial Intelligence for AutoCAD
    Find detail drawings by text and attribute content!
    6000 lines of code and and in development since 1997.
    Say goodbye to detail books.

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,789
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    Apparently you don't have any idea what it would take to decompile an exe, an read the machine code. It would be far easier for you to rewrite it.
    C:> ED WORKING....

  6. #6
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    Quote Originally Posted by aaronic_abacus
    When I originally created the code I used some projects found on vbcode.com and spliced them together. Basically I was hoping you guys could use LOOKDB.EXE to recreate the code. I need the recreated code so I can create READDB.EXE to select multiple text documents. I need a complete project.
    There was a thread here some time back that dealt with editing .exe files. This is heavy stuff. Check this out:

    http://forums.augi.com/showthread.php?t=44445
    "everything you know is wrong...." -FST

  7. #7
    I could stop if I wanted to aaronic_abacus's Avatar
    Join Date
    2006-04
    Posts
    432
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    I'm not really looking to decompile the EXE, I was hoping the project could be written by example(LOOKDB.EXE) alone.

    http://www.watsonlisp.com

    Artificial Intelligence for AutoCAD
    Find detail drawings by text and attribute content!
    6000 lines of code and and in development since 1997.
    Say goodbye to detail books.

  8. #8
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,789
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    Quote Originally Posted by aaronic_abacus
    I'm not really looking to decompile the EXE, I was hoping the project could be written by example(LOOKDB.EXE) alone.
    Then why would you expect someone else to do it for you?
    C:> ED WORKING....

  9. #9
    I could stop if I wanted to aaronic_abacus's Avatar
    Join Date
    2006-04
    Posts
    432
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    It's very simple, if you look at LOOKDB.EXE, It just creates a list of files in an ASCII text file(one file per line).
    No interaction with autocad or anything.

    http://www.watsonlisp.com

    Artificial Intelligence for AutoCAD
    Find detail drawings by text and attribute content!
    6000 lines of code and and in development since 1997.
    Say goodbye to detail books.

  10. #10
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: Help rewriting some code - create a file list and write it to a text file

    Quote Originally Posted by MikeJarosz View Post
    There was a thread here some time back that dealt with editing .exe files. This is heavy stuff. Check this out:

    http://forums.augi.com/showthread.php?t=44445
    Since I wrote this reply, I attended an ADN developer camp in Boston. Jeremy Tammik, one of the instructors, demonstrated a program that went beyond decompilation of an .exe file into assembler and actually created source code in VB and C#!!! From my class notes I found this link on Google. I have not had time to check this out, but I was impressed by Jeremy's demo!

    http://www.aisto.com/roeder/dotnet/

    Warning: be sure to read the discussion the first link refers to. This is still heavy stuff....
    "everything you know is wrong...." -FST

Page 1 of 2 12 LastLast

Similar Threads

  1. Create a list of drawings and write them to a text file
    By aaronic_abacus in forum AutoLISP
    Replies: 19
    Last Post: 2014-11-26, 07:36 AM
  2. 2014: Revit reporting Central File is not available, no one else is in file, can't save, won't create local file
    By patricks in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 3
    Last Post: 2013-10-03, 10:31 PM
  3. File write problem with NWD- /NWC-file type
    By bma in forum NavisWorks - General
    Replies: 3
    Last Post: 2010-08-31, 09:43 PM
  4. Write usernames to text file
    By mikelf in forum AutoLISP
    Replies: 8
    Last Post: 2009-01-31, 09:33 PM
  5. Read / Write To Text File
    By caddog71 in forum VBA/COM Interop
    Replies: 2
    Last Post: 2008-05-27, 06:40 PM

Posting Permissions

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