How can I write to a specific line in a text file?
Can someone make me a function sWrite(filePath as string, noLine as integer, newText as string)?
Jump to Post
Read the entire file into a text array (System.IO.File.ReadAllLines). Replace the specific entry in the text array, then write the array back to the file (System.IO.File.WriteAllLines).
All 5 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.