Click here to Skip to main content
15,895,667 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCount lines in Textfile after Insert Pin
IvanIT24-Nov-09 2:28
IvanIT24-Nov-09 2:28 
I have a block of code like so; I use to get the number of lines in a text file once I load it in a multiline textbox on my Form1.
Private Sub countLinesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles countLinesToolStripMenuItem.Click<br />
        ''count claims between ST & SE segments<br />
        Dim totLines As String() = IO.File.ReadAllLines(Me.lblClaimsFile.Text)<br />
<br />
        MessageBox.Show("The file had " & totLines.Length & " lines before processing.")<br />
    End Sub


Once this file is loaded, I do some manipulations, including inserting additional lines. I would like some codes to determine the total number of lines in the textfile after the manipulation.

I am using stringbuilder to load file contents.
Dim newString As New StringBuilder<br />
        newString.Append(My.Computer.FileSystem.ReadAllText(FileName))


TIA.
AnswerRe: Count lines in Textfile after Insert Pin
dan!sh 24-Nov-09 3:03
professional dan!sh 24-Nov-09 3:03 
GeneralRe: Count lines in Textfile after Insert Pin
IvanIT24-Nov-09 3:07
IvanIT24-Nov-09 3:07 
GeneralRe: Count lines in Textfile after Insert Pin
Dave Kreskowiak24-Nov-09 3:45
mveDave Kreskowiak24-Nov-09 3:45 
GeneralRe: Count lines in Textfile after Insert Pin
IvanIT24-Nov-09 4:01
IvanIT24-Nov-09 4:01 
AnswerRe: Count lines in Textfile after Insert Pin
Shameel24-Nov-09 4:17
professionalShameel24-Nov-09 4:17 
GeneralRe: Count lines in Textfile after Insert Pin
IvanIT24-Nov-09 4:41
IvanIT24-Nov-09 4:41 
GeneralRe: Count lines in Textfile after Insert Pin
Shameel24-Nov-09 5:24
professionalShameel24-Nov-09 5:24 
QuestionSerial Port Signal to a VB.NET program (rs232) Pin
jamith24-Nov-09 1:07
jamith24-Nov-09 1:07 
AnswerRe: Serial Port Signal to a VB.NET program (rs232) Pin
The Man from U.N.C.L.E.24-Nov-09 2:00
The Man from U.N.C.L.E.24-Nov-09 2:00 
QuestionCalling properties of one Form1 into another Form2. Pin
jeshra27923-Nov-09 18:01
jeshra27923-Nov-09 18:01 
AnswerRe: Calling properties of one Form1 into another Form2. Pin
Johan Hakkesteegt23-Nov-09 20:10
Johan Hakkesteegt23-Nov-09 20:10 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
jeshra27923-Nov-09 22:14
jeshra27923-Nov-09 22:14 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
Johan Hakkesteegt23-Nov-09 22:28
Johan Hakkesteegt23-Nov-09 22:28 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
The Man from U.N.C.L.E.24-Nov-09 1:55
The Man from U.N.C.L.E.24-Nov-09 1:55 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
jeshra27930-Nov-09 18:58
jeshra27930-Nov-09 18:58 
AnswerRe: Calling properties of one Form1 into another Form2. Pin
DaveAuld23-Nov-09 20:39
professionalDaveAuld23-Nov-09 20:39 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
dan!sh 23-Nov-09 23:48
professional dan!sh 23-Nov-09 23:48 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
DaveAuld24-Nov-09 2:52
professionalDaveAuld24-Nov-09 2:52 
AnswerRe: Calling properties of one Form1 into another Form2. Pin
Shameel24-Nov-09 2:02
professionalShameel24-Nov-09 2:02 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
jeshra27926-Nov-09 18:57
jeshra27926-Nov-09 18:57 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
Shameel27-Nov-09 5:26
professionalShameel27-Nov-09 5:26 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
jeshra27930-Nov-09 6:16
jeshra27930-Nov-09 6:16 
GeneralRe: Calling properties of one Form1 into another Form2. Pin
Shameel30-Nov-09 7:37
professionalShameel30-Nov-09 7:37 
QuestionGraphics rendering in vb.net 6.1 pro and 4.2 cf Pin
Kevin Prince23-Nov-09 10:23
Kevin Prince23-Nov-09 10:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.