- Index
- »
- io
- »
- func:ioSkip
def
func:ioSkip
ioSkip(handle, opts)
Apply a skipping operation to an input I/O handle. The following options are available (in order of processing):
- bom: skip byte order mark
- bytes: number of bytes to skip (must be binary input stream)
- chars: number of chars to skip (must be text input stream)
- lines: number of lines to skip
Skipping a BOM will automatically set the appropiate charset. If no BOM is detected, then this call is safely ignored by pushing those bytes back into the input stream. The following byte order marks are supported:
- UTF-16 Big Endian: 0xFE_FF
- UTF-16 Little Endian: 0xFF_FE
- UTF-8: 0xEF_BB_BF
Examples:
// skip leading 4 lines in a CSV file ioSkip(`io/foo.csv`, {lines:4}).ioReadCsv // skip byte order mark ioSkip(`io/foo.csv`, {bom}).ioReadCsv