Search:

Type: Posts; User: Mightymax

Search: Search took 0.01 seconds.

  1. Search directory and subfolders for one specific file

    I need to search a directory with sub folders for one specific file and get that file's directory path. All the examples I've found has been to search for a file type and place those files in a...
  2. Search File for string containing list items

    I have a list of graphic names, "graphicList". I need to search my file for each item in the graphicList in an entity string. I don't know how to reference each item in the graphicList and search for...
  3. VS 2017 Re: Match string and cut then move to the top of document

    It's SGM. I've posted an example in my post.
  4. VS 2017 Match string and cut then move to the top of document

    I've searched everywhere for this answer and I'm sorry if it's basic. I'm still very new to VB.Net. I appreciate everyone's help.

    My problem my script takes multiple files that have <Entity...>...
  5. Re: Search file for string and append file to it

    The file name will always have a unique prefix to it. I thought I could put a wild card before Ch but this didn't work.


    Dim entityFileName = $".*?_Ch{match.Groups("EntityNumber")}.sgm"

    But...
  6. Re: Search file for string and append file to it

    The file name will always have a unique prefix to it. I thought I could put a wild card before Ch but this didn't work.


    Dim entityFileName = $".*?_Ch{match.Groups("EntityNumber")}.sgm"

    But...
  7. Re: Search file for string and append file to it

    OH IT WORKED! THANK YOU SO MUCH!!!:)


    QUESTION:
    I am unfamiliar with how your checking your regex I've never seen the use of <name> in a regex statement before. Can you please explain?
  8. Re: Search file for string and append file to it

    I put the break point at the for each loop it never makes it past the for line. The rxMatches variable contains the whole strMasterDoc file not just the &Ch1; entities.

    I am unfamiliar with how...
  9. Re: Search file for string and append file to it

    No corresponding file names are "Bld1_Ch1.sgm". But the "Bld1" is a unique identifier and will change with each group of file processed.
  10. Re: Search file for string and append file to it

    entity number is a place holder for a file. It's called out as &Name;. It's not the same as Ch1.sgm, that's the file the entity is referencing
  11. Re: Search file for string and append file to it

    I loaded the code and wasn't able to get it to work. The newMasterFileBuilder copies the existing master file. The rxMatches finds "&Ch1; &Ch2; &Ch3; &Ch4; &Ch5; &Ch6; &Ch7; &Ch8;" But then nothing...
  12. Re: Search file for string and append file to it

    Thank you I'll look through this right now! I really appreciate this.
  13. Re: Search file for string and append file to it

    Thank you I'll look through this right now! I really appreciate this.
  14. Re: Search file for string and append file to it

    I'm afraid I wouldn't know how to do that. I'm comfortable with regular expressions but very new to VB.NET. Is this something you'd be willing to work with me on?
  15. Re: Search file for string and append file to it

    &CH1; is the entity placeholder and Bld1_Ch1.sgm is the file with the contents I want to copy in the master.

    Here's the latest in my code. I'm having trouble getting the replace function to work...
  16. Re: Search file for string and append file to it

    &CH1; is the entity placeholder and Bld1_Ch1.sgm is the file with the contents I wan to copy in the master.

    Here's the latest in my code. I'm having trouble getting the replace function to work on...
  17. Search file for string and append file to it

    This is a follow on question to a post I made. https://stackoverflow.com/questions/55339930/append-one-file-into-another-file/55340628#55340628

    I need to search the master document for...
  18. Replies
    11
    Views
    763

    Re: Append file to existing file

    This was the solution.


    Imports System.IO


    Dim fileToCopy = Path.Combine(searchDir, result)

    Dim fileContent = File.ReadAllText(fileToCopy)
  19. Replies
    11
    Views
    763

    Re: Append file to existing file

    This was the solution.


    Imports System.IO
    ' ...

    Dim fileToCopy = Path.Combine(searchDir, result)

    'THIS IS WHERE I WANT TO APPEND fileToCopy INTO existingFile
    Dim fileContent =...
  20. Replies
    11
    Views
    763

    Re: Append file to existing file

    I'm getting an error on AddFile function it's saying statement is not valid.
  21. Replies
    11
    Views
    763

    Re: Append file to existing file

    Thank you for providing the sample code. I'll try it out right now!
  22. Replies
    11
    Views
    763

    Re: Append file to existing file

    All the example show text being added one by one and not a whole file at the end. What would I need to write to get it to append the data to the end?
  23. Replies
    11
    Views
    763

    Append file to existing file

    Hello! I'm trying to append one file to the end of another file. I have the following and the message box returns file copied but when I check it's only inserted the path to the file.

    Thank you...
  24. Re: Create a logfile for filenames not found

    OH! If I put file in a msgbox it shows up. I just need to figure out why it's not writing to the text file
  25. Re: Create a logfile for filenames not found

    The code ran and a text file was written but it was empty. Not sure what to do.


    Dim logFile As System.IO.StreamWriter

    location = txtFolderPath.Text
    MoveLocation =...
  26. Re: Copying a File using a regex in the file name

    this is great! But my problem is i'm trying to catch line items in the text file that are not formed as a full file name. Most do not have an extension in it.


    paths = 0

    paths = 0 is variable...
  27. Re: Copying a File using a regex in the file name

    this is great! But my problem is i'm trying to catch line items in the text file that are not formed as a full file name. Most do not have an extension in it.


    paths = 0

    is the match of the...
  28. Re: Create a logfile for filenames not found

    What I'm trying to log is the list of orphaned file names in the text file that did not find a filename match.

    I get an error on the logfile because pathAndFileName aren't declared yet.
  29. Create a logfile for filenames not found

    I know this is an extension of my previous post, but the topics different which is why I'm putting it in a different post.

    My code needs to cycle through a FILENAMES text document and line by line...
  30. Re: Copying a File using a regex in the file name

    I got the code to work! Thank you for the suggestion, it lead me down the right path. Now I need to figure out how to write to an output file if there isn't a match. Any suggestions?



    ...
  31. Re: Copying a File using a regex in the file name

    thank you for responding!

    I'll get right on this and let you know how I do!
    Max
  32. Copying a File using a regex in the file name

    Greetings everyone,

    This is my first posting. I've looked around and haven't been able to find the answer to my question.

    I'm working on the following code. It's run on a text file which has a...
Results 1 to 32 of 32



Click Here to Expand Forum to Full Width