Automating a basic task.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    Automating a basic task.

    Hi here's the background, i have a process that takes place, there are four manual steps and i want to create a small program that automates them all.

    the one im stuck with is this.

    a log file is created in notepad, at the moment im opening the file in wordpad and saving as.

    the reason being notepad is not formated correctly for me to import into sql server 2000, as the lines are more than 8000 characters long because notepad cannot process the cariage return character.

    So i want to automate this...

    open up a txt file in wordpad and save as txt file again... is this possible???

    Thanks James
  • shrimant
    New Member
    • Sep 2007
    • 48

    #2
    Originally posted by jamesd0142
    Hi here's the background, i have a process that takes place, there are four manual steps and i want to create a small program that automates them all.

    the one im stuck with is this.

    a log file is created in notepad, at the moment im opening the file in wordpad and saving as.

    the reason being notepad is not formated correctly for me to import into sql server 2000, as the lines are more than 8000 characters long because notepad cannot process the cariage return character.

    So i want to automate this...

    open up a txt file in wordpad and save as txt file again... is this possible???

    Thanks James
    Can you provide a link to the Original file so that I could download it, Offcourse you can replace the end of line character with a Carriage return.....once you know what does the end of line character look like and what is the ascii value of it.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      I find the question a bit confusing. Is there actually any need to use Wordpad, or could you just do any reformatting in VB? How is the file being created? Can you please explain the process in a bit more detail?

      Also, what version of VB do you have?

      Comment

      • jamesd0142
        Contributor
        • Sep 2007
        • 471

        #4
        Originally posted by Killer42
        I find the question a bit confusing. Is there actually any need to use Wordpad, or could you just do any reformatting in VB? How is the file being created? Can you please explain the process in a bit more detail?

        Also, what version of VB do you have?
        using vb 2005 express edition.

        Formatting in vb would do what i need, the main thing is the log file has all data on 1 line, including the cariage return. so i need to open it in wordpad or word etc so that the text is formatted.

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Question moved to .NET Forum.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by jamesd0142
            using vb 2005 express edition.

            Formatting in vb would do what i need, the main thing is the log file has all data on 1 line, including the cariage return. so i need to open it in wordpad or word etc so that the text is formatted.
            From the sound of it, the problem is that the linefeeds are missing after the carriage returns. Your VB program could easily read the entire file into a string and use a single Replace() function to add the linefeeds, then write it back to the file.

            Comment

            • jamesd0142
              Contributor
              • Sep 2007
              • 471

              #7
              Originally posted by Killer42
              From the sound of it, the problem is that the linefeeds are missing after the carriage returns. Your VB program could easily read the entire file into a string and use a single Replace() function to add the linefeeds, then write it back to the file.
              ok thanks ill look into this.

              Comment

              Working...