Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

"Incomplete Last Line" error using vi

Options
  • 27-01-2009 1:33pm
    #1
    Registered Users Posts: 53 ✭✭


    Hey - I need someones help ASAP -I'm editing a file in Unix and after exiting the last file and trying to reopen it using vi as normal, I get an incomplete last line error... how do you solve this without losing any of the code???

    Your responses will be greatly appreciated :confused:

    By the way..the file is an XML file


Comments

  • Registered Users Posts: 1,996 ✭✭✭lynchie


    Unix files usually end with a newline character (\n). Your file is probably missing it. While it may not cause an issue vi is just warning you. To remove it simply goto last line and add a new line and save.


  • Registered Users Posts: 53 ✭✭bunnyfox7


    I tried this and overwrote the file and now the whole file is now only displaying in Hex and I cant convert it back... my backup is doing the same. The error is now gone and when I type in "vi myfile.xml" it just gives out hex right away... what has happened?


  • Registered Users Posts: 2,082 ✭✭✭Tobias Greeshman


    hmm thats strange. Can you try running ":display normal" in vi, see what difference that makes.

    The hex display in vi normally only occurs if vi thinks its a binary file.

    For curiosity type "file myfile.xml" at the shell prompt, see if it mentions it being a binary file.


Advertisement