Click here to Skip to main content
15,905,971 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionappend line number to a text file [SOLVED] [modified] Pin
cjdc9-Sep-09 13:53
cjdc9-Sep-09 13:53 
AnswerRe: append line number to a text file Pin
Christian Graus9-Sep-09 14:20
protectorChristian Graus9-Sep-09 14:20 
GeneralRe: append line number to a text file Pin
cjdc9-Sep-09 14:29
cjdc9-Sep-09 14:29 
GeneralRe: append line number to a text file Pin
Christian Graus9-Sep-09 14:48
protectorChristian Graus9-Sep-09 14:48 
GeneralRe: append line number to a text file Pin
cjdc9-Sep-09 14:57
cjdc9-Sep-09 14:57 
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 
Hi Luc,

Thanks for that you seem to understand part of this problem well.

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

If i use your code it writes a line number but does not increment the number.
The form already creates the text file if it does not exist, and on each use will write a new line entry.
The user will use this form to report technical issues, so there could be many issues per day, I would like each issue logged with an incremental line number, so would it have to count existing entries to establish the correct line number to write? if so how would I get it to write incremental numbers and check to see how many entries already existed.

I hope I'm explaining this right or it might be easier to send you my project so you can see what goes on.

Thanks again for helping and taking time to reply.
Regards
CJ
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 
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 

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.