From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113364 invoked by alias); 12 Oct 2018 23:53:00 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 113337 invoked by uid 89); 12 Oct 2018 23:53:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:ip*192.168.1.6, H*M:charter, squeeze, jerry X-HELO: mtaout003-public.msg.strl.va.charter.net Received: from mtaout003-public.msg.strl.va.charter.net (HELO mtaout003-public.msg.strl.va.charter.net) (68.114.190.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Oct 2018 23:52:58 +0000 Received: from impout002 ([68.114.189.17]) by mtaout003.msg.strl.va.charter.net (InterMail vM.9.00.023.01 201-2473-194) with ESMTP id <20181012235256.QGGO7355.mtaout003.msg.strl.va.charter.net@impout002>; Fri, 12 Oct 2018 18:52:56 -0500 Received: from [192.168.1.6] ([66.191.41.128]) by impout002 with charter.net id mnsv1y0032lujD601nsvPY; Fri, 12 Oct 2018 18:52:56 -0500 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 Subject: Re: read CSV data consistently from string or file To: "Browning, Robert S IV ERDC-RDE-GSL-MS CIV" , "fortran@gcc.gnu.org" References: <10B680D9-A65E-4B86-9F7C-760184201DAB@contoso.com> <0A2AF1BD-224D-4EC7-BD4C-52CEBBDAF1AF@erdc.dren.mil> <80D3D374-24CC-4283-BDDC-6355F0E05AC6@erdc.dren.mil> From: Jerry DeLisle Message-ID: <10d458a1-d2e6-fd1e-abc0-0126f03d0271@charter.net> Date: Fri, 12 Oct 2018 23:53:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <80D3D374-24CC-4283-BDDC-6355F0E05AC6@erdc.dren.mil> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00056.txt.bz2 On 10/12/18 1:10 PM, Browning, Robert S IV ERDC-RDE-GSL-MS CIV wrote: > I am needing to read in a text file that contains numerical data separated by keywords. Because of the keywords, I need to read each line in as text first and test if it’s a keyword, and then call the appropriate subroutine based on the keyword value. Within the subroutines I also need to read each line as text first so I can stop the subroutine when the next keyword is found. > > The numerical data can be in either fixed format or comma-separated-value (CSV) format. In the CSV data, a zero could be represented by a pair of commas with no number between them. > > The issue I have encountered is that the read statement appears to behave differently when it is reading from a character string than when it is reading directly from the input file. If I were able to read directly from the input file, then a simple formatted read statement does everything I need. But if I am reading from a string, then things get a bit more complicated. Hi Robert, This may be a known bug. It sounds familiar. Let me do some checking. Fortranners, if I confirm this is the bug I think it is, I think I can squeeze some time to fix it. Jerry