[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence
From: |
Matthias Brennwald |
Subject: |
[Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.) |
Date: |
Sat, 3 Mar 2018 12:58:46 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0 |
URL:
<http://savannah.gnu.org/bugs/?53277>
Summary: textscan(...) does not parse sequence of integers
separated by dots (.)
Project: GNU Octave
Submitted by: mbrennwa
Submitted on: Sat 03 Mar 2018 05:58:45 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.1
Operating System: Any
_______________________________________________________
Details:
I am trying to read data from a file with dates in DAY.MONTH.YEAR format using
the textscan(...) function. Below is a simple illustration of the problem.
This does not work as desired:
u = textscan ('5.2.1975','%d.%d.%d')
u =
{
[1,1] = 5
[1,2] = 1975
[1,3] = 0
}
It seems textscan treats the 5.2 part as a decimal number and rounds it to 5.
It returns the last number (1975) as the second element of u.
The conversion works as expected if the separator is not a dot:
u = textscan ('5*2*1975','%d*%d*%d')
u =
{
[1,1] = 5
[1,2] = 2
[1,3] = 1975
}
I have asked about this on stackexchange. The feedback was that my dot example
works as expected on Octave 4.0.3. See here:
https://stackoverflow.com/questions/49075425/gnu-octave-use-textscan-function-to-read-sequence-of-integers-separated-by-a
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53277>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.),
Matthias Brennwald <=
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Dildar Sk, 2018/03/03
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Philip Nienhuis, 2018/03/03
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Matthias Brennwald, 2018/03/04
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Matthias Brennwald, 2018/03/04
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Philip Nienhuis, 2018/03/04
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Philip Nienhuis, 2018/03/04
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Rik, 2018/03/05
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Matthias Brennwald, 2018/03/05
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Philip Nienhuis, 2018/03/05
- [Octave-bug-tracker] [bug #53277] textscan(...) does not parse sequence of integers separated by dots (.), Philip Nienhuis, 2018/03/08