Open sysilviakim opened 1 year ago
Do the people giving this a thumbs up also have different examples of this problem? If so, please share! @bernardlf @jay-sf
@jennybc Found alternative solution there: https://stackoverflow.com/a/76759892/6574038 Cheers! J
Hello team,
Thank you for the amazing package! I have an importing issue---I'm sure I'm doing something silly, but I can't quite figure it out. Both
read_fwf
andvroom_fwf
are producing files that lack one line (the first line, to be precise) when importing fixed-width files. Edit: it only does this whenn_max
is specified as a value other thanInf
, or when the file is a local file in a Windows machine: see Stack Overflow post here.There are two files:
Suppose that the fixed-width file and the CSV file are at the root directory. The code I used is (a part of a larger codebase)
This will only produce one row of data. But there are two lines in this raw file, as evidenced by
which produces two lines as expected. If I leave only one line in the raw data, it'll produce zero imported rows.
Now, if
n_max = Inf
as in the default, it's fine:Even with
n_max = 1000
specified, the following works fine, too: the original files have been uploaded to GitHub and are being directly called from there:I am not sure where I've gone wrong. They are literally the same files, and I've checked that
col_positions
is not the problem. Perhaps it is a line-ending issue? My session info is as follows:Has anybody encountered a similar problem? Thank you very much.