# (write-line string \[file-descriptor\]) [GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md) <a id="310"></a> ## (write-line string \[file-descriptor\]) --- Write that string to a file. --- This function is more practical and efficient to use than the [write-char](%28write-char%20character%20-file-descriptor-%29.md) function. Anything can be written into a file, since the format is a *string*. The file is specified by the *file-descriptor*, assigned by the [open](%28open%20filename%20mode%29.md) function. When the *file-descriptor* is left out, the *string* is written to the command line and Prompt History window. ### Examples | Code | Returns | Prints to File | | --- | --- | --- | | (setq fil (open "sample.lsp" "w")) | | | | (**write-line** "Name:" fil) | "Name:" | Name: | | (**write-line** "Address:" fil) | "Address:" | Address: | **Tell me about...** [(read-line \[file-descriptor\])](%28read-line%20-file-descriptor-%29.md) [(setq symbol1 statement1 \[symbol2 statement2\] ...)](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%29.md) [LISP Compatibility](../LISP%20Compatibility.md) [Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md) <a id="holding"></a> ## Other versions with matching text [GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28write-line%20string%20-file-descriptor-%29.md)