none
I have a text file created from visual studio but when I open the file by note pad, I discovered that last 5% or 10% of the file not shown in the note pad. RRS feed

  • Question

  • Hi,

    I have a text file created from visual studio but when I open the file by note pad, I discovered that last 5% or 10% of the file not shown in the note pad.

    Can any one assist me of how to solve this problem.

    Is that problem related to visual studio or its note pad problem.

    Kind Regards,


    Hany Metry


    • Edited by Hany Metry Wednesday, November 13, 2019 5:07 PM
    Wednesday, November 13, 2019 5:05 PM

Answers

  • Are you flushing the stream before the program ends?

    file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:", Font6)
                        file.WriteLine("========================================================================", Font6)
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        
                        file.Flush()
    

    - Wayne

    • Marked as answer by Hany Metry Thursday, November 14, 2019 2:41 PM
    Thursday, November 14, 2019 2:12 PM
  • Hi All,

    I found my mistake.

    I did write the following code at the end of stream

    file.Close()

    After write it, all my problem is solved and the file is written in the text file complete.

    Sorry I am really bad and usually ask wrong questions as Leshay Said.


    Hany Metry


    • Marked as answer by Hany Metry Thursday, November 14, 2019 2:40 PM
    • Edited by Hany Metry Thursday, November 14, 2019 3:15 PM wrong instead of wring
    Thursday, November 14, 2019 2:40 PM

All replies

  • Hi,

    I have a text file created from visual studio but when I open the file by note pad, I discovered that last 5% or 10% of the file not shown in the note pad.

    Can any one assist me of how to solve this problem.

    Is that problem related to visual studio or its note pad problem.

    Kind Regards,


    Hany Metry


    No, the problem is related to you .............................

    Regards Les, Livingston, Scotland

    Wednesday, November 13, 2019 5:14 PM
  • First thing to try is using NotePad++ instead of Windows NotePad.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, November 13, 2019 5:16 PM
    Moderator
  • First thing to try is using NotePad++ instead of Windows NotePad.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Hi Karen,

    Note Pad ++ have the same problem.

    Kind Regards,


    Hany Metry

    Wednesday, November 13, 2019 5:45 PM
  • First thing to try is using NotePad++ instead of Windows NotePad.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Hi Karen,

    Note Pad ++ have the same problem.

    Kind Regards,


    Hany Metry

    About what size is the file you are having issues with?

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, November 13, 2019 5:50 PM
    Moderator
  • About what size is the file you are having issues with?


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    The size of file is 8192 bytes.



    Hany Metry


    • Edited by Hany Metry Wednesday, November 13, 2019 6:41 PM
    Wednesday, November 13, 2019 6:40 PM
  • Hi All,

    After debug all the unwritten lines in the note pad or note pad++, I find the program path to that lines.

    I guess that, there is no problem of visual studio.

    Kind Regards,

     


    Hany Metry

    Wednesday, November 13, 2019 6:57 PM
  • I'm going to guess you are iterating some line by line read. Can we look at that?

    https://awwshop.wikidot.com

    Wednesday, November 13, 2019 7:43 PM
  • Hi,

    I have a text file created from visual studio but when I open the file by note pad, I discovered that last 5% or 10% of the file not shown in the note pad.

    Can any one assist me of how to solve this problem.

    Is that problem related to visual studio or its note pad problem.

    Kind Regards,


    Hany Metry


    No, the problem is related to you .............................

    Regards Les, Livingston, Scotland

    Hi leshay,

    You have to know that, I have prepared first version of that program from June 2016 and save properties, I have finished it from June 2016 and I do not remember every thing I have did from 2016, So I was not remember that FileName1 include extension and Path.

    Kind Regards,



    Hany Metry

    Wednesday, November 13, 2019 7:58 PM
  • I'm going to guess you are iterating some line by line read. Can we look at that?

    https://awwshop.wikidot.com

    If Form2GeneralInformation.RadioButton7.Checked = True Then file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:") file.WriteLine("========================================================================") Dim format As String = "{0,7:D}{1,21:####0.00}{2,17:####0.00}{3,19:####0.00}{4,19:####0.000}" file.WriteLine(" Pu Mux Muy F.O.S.") file.WriteLine(" No. KN KNm KNm Vector ") For I = 0 To Num1 - 1 Dim line As String line = String.Format(format, I + 1, PPP(I), Muxx(I), Muyy(I), FOS(I)) file.WriteLine(line) Next Else End If

    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("End Report")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")
                    file.WriteLine("     ")


    Hi Geo,

    The above are the lines which not written or not shown in Note Pad or Note Pad++

    As you see it is same as all previous lines   include       file.WriteLine    .......

    N.B.   I added many empty lines to test the Note Pad    or Note Pad++ 

    Kind Regards,


    Hany Metry


    • Edited by Hany Metry Wednesday, November 13, 2019 8:28 PM N.B. I added many empty lines to test the Note Pad or Note Pad++
    Wednesday, November 13, 2019 8:06 PM
  • Are you opening Notepad with code?

    https://awwshop.wikidot.com

    Wednesday, November 13, 2019 9:47 PM
  • Are you opening Notepad with code?

    https://awwshop.wikidot.com

    I open created text file by Notepad but not the code.

    Hany Metry

    Wednesday, November 13, 2019 10:55 PM
  • From what I can see, it's one of two things.

    1. Hardware - Delete the file and make a new one.

    2. Your WriteLine is not being processed at some point. (Cut writes in half and then investigate until it works. After that start adding more lines... You may even have a write error from the line that didn't make it.)


    https://awwshop.wikidot.com


    • Edited by GeoFrias Wednesday, November 13, 2019 11:08 PM
    • Marked as answer by Hany Metry Thursday, November 14, 2019 8:48 AM
    • Unmarked as answer by Hany Metry Thursday, November 14, 2019 9:04 AM
    Wednesday, November 13, 2019 11:06 PM
  • From what I can see, it's one of two things.

    1. Hardware - Delete the file and make a new one.

    2. Your WriteLine is not being processed at some point. (Cut writes in half and then investigate until it works. After that start adding more lines... You may even have a write error from the line that didn't make it.)


    https://awwshop.wikidot.com


    If Form2GeneralInformation.RadioButton7.Checked = True Then
                        file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:")
                        file.WriteLine("========================================================================")
                        Dim format As String = "{0,7:D}{1,21:####0.00}{2,17:####0.00}{3,19:####0.00}{4,19:####0.000}"
                        file.WriteLine("                        Pu               Mux                Muy               F.O.S.")
                        file.WriteLine("     No.                KN               KNm                KNm               Vector                              ")
                        For I = 0 To Num1 - 1
                            Dim line As String
                            line = String.Format(format, I + 1, PPP(I), Muxx(I), Muyy(I), FOS(I))
                            file.WriteLine(line)
                        Next
                    Else

    Hi,

    After the program check if statement in the code above the text file contain

    file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:")

    is written ok in text file while the next line is not written.

    N.B. The length of characters of the next line which is not written are 72 characters

    What is the maximum characters length allowed in note pad or note pad++? 

    file.WriteLine("========================================================================")

    And all the files created by the program stop at the same line.

     


    Hany Metry


    • Edited by Hany Metry Thursday, November 14, 2019 8:32 AM What is the maximum characters length allowed in note pad or note pad++?
    • Marked as answer by Hany Metry Thursday, November 14, 2019 8:47 AM
    • Unmarked as answer by Hany Metry Thursday, November 14, 2019 9:04 AM
    Thursday, November 14, 2019 8:26 AM
  • From what I can see, it's one of two things.

    1. Hardware - Delete the file and make a new one.

    2. Your WriteLine is not being processed at some point. (Cut writes in half and then investigate until it works. After that start adding more lines... You may even have a write error from the line that didn't make it.)


    https://awwshop.wikidot.com


    If Form2GeneralInformation.RadioButton7.Checked = True Then
                        file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:")
                        file.WriteLine("========================================================================")
                        Dim format As String = "{0,7:D}{1,21:####0.00}{2,17:####0.00}{3,19:####0.00}{4,19:####0.000}"
                        file.WriteLine("                        Pu               Mux                Muy               F.O.S.")
                        file.WriteLine("     No.                KN               KNm                KNm               Vector                              ")
                        For I = 0 To Num1 - 1
                            Dim line As String
                            line = String.Format(format, I + 1, PPP(I), Muxx(I), Muyy(I), FOS(I))
                            file.WriteLine(line)
                        Next
                    Else

    Hi,

    After the program check if statement in the code above the text file contain

    file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:")

    is written ok in text file while the next line is not written.

    N.B. The length of characters of the next line which is not written are 72 characters

    What is the maximum characters length allowed in note pad or note pad++? 

    file.WriteLine("========================================================================")

    And all the files created by the program stop at the same line.

     


    Hany Metry


    Hi,

    When I reduce the number of characters for line problem to be 70, the line is written in the text file while there are other lines at the top of file of which number of characters exceed 70 by many (more than 80) and written in the files.

    So there is no logic ????

    Kind Regards,


    Hany Metry


    • Marked as answer by Hany Metry Thursday, November 14, 2019 8:47 AM
    • Edited by Hany Metry Thursday, November 14, 2019 9:04 AM When I reduce the number of characters for line problem to be 70, the line is written in the text file while there are other lines at the top of file of which number of characters exceed 70 by many (more than 80) and written in the files.
    • Unmarked as answer by Hany Metry Thursday, November 14, 2019 9:04 AM
    Thursday, November 14, 2019 8:47 AM
  • Hi All,

    How we can change font and size of font of text file before it is written.

    And how to make the text file wrap text before it is print to don't cancel the lines which exceed number of characters than certain limit.

    How to make font name Console and of size 9???

    Kind Regards,



    Hany Metry



    • Edited by Hany Metry Thursday, November 14, 2019 10:30 AM How to make font name Console and of size 9???
    Thursday, November 14, 2019 9:22 AM
  • Hi All,

    How we can change font and size of font of text file before it is written.

    And how to make the text file wrap text before it is print to don't cancel the lines which exceed number of characters than certain limit.

    How to make font name Console and of size 9???

    Kind Regards,



    Hany Metry



    Hi All,

    The user may choose the font of text file by the code below.

    Dim Font6 As New Font("Console", 9, FontStyle.Regular)
    file.WriteLine(TV, Font6)

    font6 shall be written in the first line code only and no need to re-write font6 at all line code.

    Even I changed the font to be Console 9 Regular but still I have a problem to complete the file.

    One line code is added after change the font and not complete the text file.

    At the top of the file there was line of 94 characters length and written without any problem.

    Kind Regards,  


    Hany Metry


    • Edited by Hany Metry Thursday, November 14, 2019 11:28 AM
    Thursday, November 14, 2019 11:24 AM
  • From what I can see, it's one of two things.

    1. Hardware - Delete the file and make a new one.

    2. Your WriteLine is not being processed at some point. (Cut writes in half and then investigate until it works. After that start adding more lines... You may even have a write error from the line that didn't make it.)


    https://awwshop.wikidot.com


    I changed the code as below with very short lines.

    And also the soft copy of the text file not include any of the short lines.

    file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:", Font6)
                        file.WriteLine("========================================================================", Font6)
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")


    Nothing of Hello lines are written in the text file.

    Below image show what printed in text file 

    And when I change the code to be as below

    h Corresponding Ultimate Factor of Safety:", Font6) file.WriteLine("Hello") file.WriteLine("Hello") file.WriteLine("Hello") file.WriteLine("Hello") file.WriteLine("Hello") file.WriteLine("Hello") file.WriteLine("========================================================================", Font6)


    The image of out put as below

    The program does not complete the 6th Hello.

    Then the program write texts till certain limits after      "Factored Loads and Moments with Corresponding Ultimate Factor of Safety". 

    I think that it is not a problem of font size or font or ..... and it is a problem of hard ware of my computer or problem of window or I don't know.

    At least it is not a problem of visual studio because when I debug, I find the program path to all unwritten lines.

    I can't solve more than that.



    Hany Metry



    • Edited by Hany Metry Thursday, November 14, 2019 2:14 PM At least it is not a problem of visual studio because when I debug, I find the program path to all unwritten lines.
    Thursday, November 14, 2019 1:42 PM
  • Are you flushing the stream before the program ends?

    file.WriteLine("Factored Loads and Moments with Corresponding Ultimate Factor of Safety:", Font6)
                        file.WriteLine("========================================================================", Font6)
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        file.WriteLine("Hello")
                        
                        file.Flush()
    

    - Wayne

    • Marked as answer by Hany Metry Thursday, November 14, 2019 2:41 PM
    Thursday, November 14, 2019 2:12 PM
  • Hi All,

    I found my mistake.

    I did write the following code at the end of stream

    file.Close()

    After write it, all my problem is solved and the file is written in the text file complete.

    Sorry I am really bad and usually ask wrong questions as Leshay Said.


    Hany Metry


    • Marked as answer by Hany Metry Thursday, November 14, 2019 2:40 PM
    • Edited by Hany Metry Thursday, November 14, 2019 3:15 PM wrong instead of wring
    Thursday, November 14, 2019 2:40 PM