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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

"Incomplete Last Line" error using vi

  • 27-01-2009 12:33pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 2,013 ✭✭✭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, Registered Users 2 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, Registered Users 2 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