Commit 59f966c
implement comment.char argument for fread (#7375)
* implement comment.char argument for fread
* remove handling of comment.char=NULL
* update NEWS
* update tests
* change wording for error
* remove unreachable code
* add helper function
* extend tests
* update tests
* use skip_line helper
* add comments for helpers
* fix test numbering
* add more tests
* simplify read
* Revert "simplify read"
This reverts commit a0a9525.
* separate helpers
* add comments
* add coverage
* simplify header handling
* increase coverage
* simplify code
* control skipping white spaces before comments with strip.white
* tighten helper
* try improving readability with blank lines
* include some line-end comments in the multi-line comment test
* match read.table for na.strings and comment.char
* add strip.white=FALSE header testcase
* refactor end_of_field helper into more readable version
* add example for strip.white
* summarize line-skipping behavior
* clean up tmp
* don't introduce whitespace to string literal body
---------
Co-authored-by: Michael Chirico <[email protected]>1 parent 67129f0 commit 59f966c
File tree
8 files changed
+257
-15
lines changed- R
- inst/tests
- man
- src
8 files changed
+257
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
289 | 292 | | |
290 | 293 | | |
291 | 294 | | |
292 | | - | |
| 295 | + | |
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21688 | 21688 | | |
21689 | 21689 | | |
21690 | 21690 | | |
| 21691 | + | |
| 21692 | + | |
| 21693 | + | |
| 21694 | + | |
| 21695 | + | |
| 21696 | + | |
| 21697 | + | |
| 21698 | + | |
| 21699 | + | |
| 21700 | + | |
| 21701 | + | |
| 21702 | + | |
| 21703 | + | |
| 21704 | + | |
| 21705 | + | |
| 21706 | + | |
| 21707 | + | |
| 21708 | + | |
| 21709 | + | |
| 21710 | + | |
| 21711 | + | |
| 21712 | + | |
| 21713 | + | |
| 21714 | + | |
| 21715 | + | |
| 21716 | + | |
| 21717 | + | |
| 21718 | + | |
| 21719 | + | |
| 21720 | + | |
| 21721 | + | |
| 21722 | + | |
| 21723 | + | |
| 21724 | + | |
| 21725 | + | |
| 21726 | + | |
| 21727 | + | |
| 21728 | + | |
| 21729 | + | |
| 21730 | + | |
| 21731 | + | |
| 21732 | + | |
| 21733 | + | |
| 21734 | + | |
| 21735 | + | |
| 21736 | + | |
| 21737 | + | |
| 21738 | + | |
| 21739 | + | |
| 21740 | + | |
| 21741 | + | |
| 21742 | + | |
| 21743 | + | |
| 21744 | + | |
| 21745 | + | |
| 21746 | + | |
| 21747 | + | |
| 21748 | + | |
| 21749 | + | |
| 21750 | + | |
| 21751 | + | |
| 21752 | + | |
| 21753 | + | |
| 21754 | + | |
| 21755 | + | |
| 21756 | + | |
| 21757 | + | |
| 21758 | + | |
| 21759 | + | |
| 21760 | + | |
| 21761 | + | |
| 21762 | + | |
| 21763 | + | |
| 21764 | + | |
| 21765 | + | |
| 21766 | + | |
| 21767 | + | |
| 21768 | + | |
| 21769 | + | |
| 21770 | + | |
| 21771 | + | |
| 21772 | + | |
| 21773 | + | |
| 21774 | + | |
| 21775 | + | |
| 21776 | + | |
| 21777 | + | |
| 21778 | + | |
| 21779 | + | |
| 21780 | + | |
| 21781 | + | |
| 21782 | + | |
| 21783 | + | |
| 21784 | + | |
| 21785 | + | |
| 21786 | + | |
| 21787 | + | |
| 21788 | + | |
| 21789 | + | |
| 21790 | + | |
| 21791 | + | |
| 21792 | + | |
| 21793 | + | |
| 21794 | + | |
| 21795 | + | |
| 21796 | + | |
| 21797 | + | |
| 21798 | + | |
| 21799 | + | |
| 21800 | + | |
| 21801 | + | |
| 21802 | + | |
| 21803 | + | |
| 21804 | + | |
| 21805 | + | |
| 21806 | + | |
| 21807 | + | |
| 21808 | + | |
| 21809 | + | |
| 21810 | + | |
| 21811 | + | |
| 21812 | + | |
| 21813 | + | |
| 21814 | + | |
| 21815 | + | |
| 21816 | + | |
| 21817 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
0 commit comments