I've copied a file from HDFS into my local file system (all on RH linux). However, after the copy, if I cat
the file, I see the following:
[me@ac12 ~]$ cat file_copy
0|name|string
1|phone|string
2|age|string[me@ac12 ~]$
What I expected was this:
[me@ac12 ~]$ cat file_copy
0|name|string
1|phone|string
2|age|string
[me@ac12 ~]$
You can see that a newline seems to be missing in the first cat, and the shell prompt is on the same line as the last line. Why would this be and how can I diagnose the issue?
EDIT: I can't edit the output file (well, maybe I could but I really don't want to - I'd rather fix the problem at the source). I want to know why there is no newline character..
You can use this
sed
to add a newline after last line:EDIT:
Or else use (thanks to @JonathanLeffler):