How to perform such an algorithm? read the file, delete the first character in all lines. add a new character to the beginning of the line (each line)
Closed due to the fact that the essence of the issue is not clear to the participants of Saidolim , Grundy , Cerbo , Athari , Pavel Mayorov Apr 25 '16 at 9:47 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
- So do: "read the file, delete the first character in all lines. Add a new character to the beginning of the line (each line)". Which item is causing difficulties? Did you try to write code? - Pavel Mayorov
|
1 answer
For example, something like this:
string temppath = path + ".temp"; File.WriteAllLines(temppath, File.ReadLines(path) .Select(line => line == "" ? "" : 'Ы' + line.Substring(1))); File.Delete(path); File.Move(temppath, path); On-site will not work lightly, since Unicode.
- How can I write this: there are 5 lines, each line starts with a different letter, it is necessary that the software displays only the line whose first letter matches the letter from the TXT file on the slave table, that is, the line if the line starts with the letter zapadlo (the first letter z ) and in my first letter of the line k, then this line (zapadlo) will not be ordered, but only the one that starts with the letter d in the word tha dinamo will be shown, something like that - komra23
- @ May_be: Not entirely clear. maybe give an example? The letter from the file on the desktop - do you mean any letter? The first letter of any line? (In general, an example is better.) - VladD
- Can we discuss it in HP?)) To the public, somehow, khm khmmm - komra23
- @ May_be: You can, but tomorrow I will most likely be inaccessible. Now create a chat. - VladD
- @May_be: chat.stackexchange.com/rooms/38762/room-for-may-be-and-vladd - VladD
|