Click here to Skip to main content
15,896,730 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: append line number to a text file Pin
Christian Graus9-Sep-09 15:05
protectorChristian Graus9-Sep-09 15:05 
AnswerRe: append line number to a text file Pin
Luc Pattyn9-Sep-09 15:21
sitebuilderLuc Pattyn9-Sep-09 15:21 
GeneralRe: append line number to a text file Pin
cjdc10-Sep-09 7:03
cjdc10-Sep-09 7:03 
GeneralRe: append line number to a text file Pin
Luc Pattyn10-Sep-09 7:12
sitebuilderLuc Pattyn10-Sep-09 7:12 
AnswerRe: append line number to a text file Pin
Hurricane300010-Sep-09 8:12
Hurricane300010-Sep-09 8:12 
GeneralRe: append line number to a text file Pin
cjdc10-Sep-09 9:09
cjdc10-Sep-09 9:09 
GeneralRe: append line number to a text file Pin
Hurricane300010-Sep-09 9:30
Hurricane300010-Sep-09 9:30 
GeneralRe: append line number to a text file [modified] Pin
cjdc10-Sep-09 10:05
cjdc10-Sep-09 10:05 
HI Hurricane3000,

Perhaps I mean to add an inc remental number as the lines are sent to the text file so that the line numbers are counted and added to as the file grows.
There is no limit to the max characters typed per line but usually is just a brief explanation of the issue
here's what I have so far:

' This text is always added, making the file longer over time
sw = IO.File.AppendText(path)
sw.WriteLine(DateTime.Now.ToString() + "," + "Reason," + (RichTextBox2.Text)
so where I'm using writeline i would need it to add a incremental line number first, so if the log already had two entries it would need to put a number 3 before datetime.now, so I think it would somehow have to count any existing lines in my text file.

My text file at present is as follows:

IT Report Log File Started,10/09/2009 02:03:53
**********************************************
10/09/2009 18:32:27,Reason,test,Approx Time,Duration
10/09/2009 18:32:33,Reason,pc would not power on,Approx Time,Duration

So as each line is made I would like it to be numbered before the date entry.
to continue as follows:

IT Report Log File Started,10/09/2009 02:03:53
**********************************************
1. 10/09/2009 18:32:27,Reason,test,Approx Time,Duration
2. 10/09/2009 18:32:33,Reason,pc would not power on,Approx Time,Duration

Then when a new entry is submitted from my textbox it will write line number 3 and so on

If this doesn't help I could sent you my project

Regards
CJ

modified on Thursday, September 10, 2009 4:26 PM

GeneralRe: append line number to a text file Pin
Hurricane300010-Sep-09 10:33
Hurricane300010-Sep-09 10:33 
GeneralRe: append line number to a text file Pin
cjdc10-Sep-09 10:49
cjdc10-Sep-09 10:49 
AnswerRe: append line number to a text file Pin
Hurricane300011-Sep-09 4:54
Hurricane300011-Sep-09 4:54 
GeneralRe: append line number to a text file Solved Pin
cjdc14-Sep-09 0:25
cjdc14-Sep-09 0:25 
Questioncomputer to computer communication event Pin
computbill9-Sep-09 13:09
computbill9-Sep-09 13:09 
AnswerRe: computer to computer communication event Pin
Christian Graus9-Sep-09 13:52
protectorChristian Graus9-Sep-09 13:52 
QuestionClass not registered Pin
RossouwDB9-Sep-09 9:01
RossouwDB9-Sep-09 9:01 
AnswerRe: Class not registered Pin
Christian Graus9-Sep-09 9:22
protectorChristian Graus9-Sep-09 9:22 
GeneralRe: Class not registered Pin
RossouwDB9-Sep-09 10:44
RossouwDB9-Sep-09 10:44 
GeneralRe: Class not registered Pin
Christian Graus9-Sep-09 11:20
protectorChristian Graus9-Sep-09 11:20 
GeneralRe: Class not registered Pin
RossouwDB10-Sep-09 5:01
RossouwDB10-Sep-09 5:01 
GeneralRe: Class not registered Pin
RossouwDB12-Sep-09 5:08
RossouwDB12-Sep-09 5:08 
QuestionSuspendLayout, changing Width property and ResumeLayout(True) Pin
EliottA9-Sep-09 7:46
EliottA9-Sep-09 7:46 
QuestionPossible to pass a string to a Function as name of an array? Pin
Hurricane30009-Sep-09 5:42
Hurricane30009-Sep-09 5:42 
AnswerRe: Possible to pass a string to a Function as name of an array? Pin
Dave Kreskowiak9-Sep-09 6:17
mveDave Kreskowiak9-Sep-09 6:17 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Hurricane30009-Sep-09 7:19
Hurricane30009-Sep-09 7:19 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Christian Graus9-Sep-09 9:26
protectorChristian Graus9-Sep-09 9:26 

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.