I am trying to parse a giant log file using node.js, the file does not seem to get '\n' but when I do set list in vi it shows me '$" at the end of every line, does anyone know what that is. I means can I split a string on that.
set list command in vi
I would recommend checking out your file via
cat -v -e
which will show you all unprintable characters and line endings.
cat -v -e >> newfile.txt –
Dunagan
the $ indicates end of line. The 'set list' command is very useful in identifying trailing white space at the end of a line.
It happens when you do set list
, so you should read :h 'list'
instead of asking this here. Everything what you need to know about this $
is stated in the help.
Second question (splitting string on end-of-line) is answered in :h getline()
. I also doubt that file really does not have a NL so write here how did you came to conclusion «the file does not seem to get '\n'».
It is rare that there is a poster who could not get a little way further by using man, info, h, ?, help or whatever. Frankly, cli man files are often only of use when you are a regular user of whatever command is being asked about. If you are going to post answers of the form RTFM, why bother? Why not just sit in your ivory tower and gaze imperiously down at all those folks who solve their problems by talking to one another instead of reading the manual. –
Copeck
Totally agree with you @nerak99;
:help list
goes to section 1.3 in the reference manual which is about lists as an "ordered sequence of items"; and not the config option.Using single quotes - :help 'list'
(as indicated in @D answer) shows the configuration option. Without this question I would not have been able to find the help for list as a config option. –
Noe © 2022 - 2025 — McMap. All rights reserved.
man cat
. Thanks! – Occidental