0

I want to write to first line of an existing text file which has plenty of lines in it. I just wanted to add one line at the starting of the file.

user1614862
  • 3,701
  • 7
  • 29
  • 46
  • 4
    There's no way to insert at the start of a file. YOu'll have to create a new file, write your new line, then copy the original file's contents after that. – Marc B Nov 20 '13 at 21:54
  • 1
    @MarcB: who says that this is not the solution the OP is looking for? – Doc Brown Nov 20 '13 at 21:56
  • Ohhh....there is no way?? It is surprising to me. Anyway thanks Marc. – user1614862 Nov 20 '13 at 21:58
  • 1
    @user1614862: nonsense, its perfectly possible the way Marc B described it, read the answers at the link of Howard Renollet. – Doc Brown Nov 20 '13 at 22:00
  • I understand that, I was just assuming there may be a direct solution with some flag. – user1614862 Nov 20 '13 at 22:13
  • But copying files from one to another is becoming an overhead, because my files are very huge and they are present at the network location. Any better solution for this? – user1614862 Nov 20 '13 at 22:44

0 Answers0