[comp.unix.questions] Difficulty with the editing mode

gyounger@ardec.arpa (AED-EWD) (12/16/88)

I transferred a file from my floppy disk to my unix file(I believe this
is called uploading of a file). This file has 125211 characters and was
named mbox.9.When I used the vi command on the mbox.9, I got a surprise
response "mbox.9" Executable;and if I tried to work on the file while
in the vi edit mode,the file was reduced from 125211 of information down
to one line of information. I never had this problem before on the old
Gould 86 computer. We(the directorate) are now on a new system called
Pyramid;and I am using a WYSEpc. I was able to overcome the problem
by sending the troublesome uploaded file to myself and listing it
with a new name. I was able to use the vi command on the new name without
any problems. How come I could not use the vi command on this uploaded
file.

moss@BRL.MIL (VLD/VMB) (12/16/88)

George,
	It sounds like your file has no new-line characters in it.  Different
systems use different characters to represent the end of a line in a text
file; Unix uses the ASCII code for linefeed ('\n') which is 012 (octal).  The
vi editor doesn't see any '\n' character, so it thinks there is just one line
of text.

	Use the following command to examine the contents of your file and
ascertain what is being used to represent a new-line:

od -bc < file | more

	Then write a 'C' program which transposes that character or sequence
of characters to 012 or '\n'.

-moss