Search notes:

vim script: readfile

" ..\run_ readfile


" Create a file, named readfile.txt and write
" three lines: foo, bar and baz:
new 
execute "normal ifoo\<CR>bar\<CR>baz\<ESC>"
write readfile.txt


redir > readfile.out
" Read the created file and echo it
let s:lines = readfile('readfile.txt')
for s:line in s:lines
  echo s:line
endfor

redir END

call delete('readfile.txt')
q
Github repository about-vim, path: /vimscript/functions/readfile.vim

See also

writefile
Vim: built in functions
VIM script

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758184628, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/vim/script/vimscript/functions/readfile(64): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78