<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hang on - a line can be more in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972652#M97493</link>
    <description>&lt;P&gt;Hang on - a line can be more than ten characters and you will get a response less than 10, LEN_TRIM tells you the significant length of what's been read, not what was the original line.&amp;nbsp; If you have a line with&lt;/P&gt;
&lt;P&gt;[plain]123456789 ABCDEF[/plain]&lt;/P&gt;
&lt;P&gt;and you read it into a CHARACTER(10) variable, the variable will contain '123456789 ', where the last character is a blank. &lt;/P&gt;
&lt;P&gt;LEN_TRIM of that is then 9.&amp;nbsp; Trailing blanks are not counted.&amp;nbsp; That's independent of where they originally come from.&lt;/P&gt;
&lt;P&gt;Is that what you are referring to?&amp;nbsp; If so, and you want to count trailing blanks that were originally in the line, then you need to do things a little differently. &lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2013 20:43:05 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2013-11-01T20:43:05Z</dc:date>
    <item>
      <title>TXT file not read properly by Fortran I/O. Why?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972645#M97486</link>
      <description>&lt;P&gt;* Why can't I attach the test file? *****&lt;/P&gt;
&lt;P&gt;BTW "select media" hangs it up, and the whole thing is lost.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This file looks fine when I read it in with NOTEPAD or some other editor, but when&lt;/P&gt;
&lt;P&gt;the Fortran I/O library reads it in, it truncates lines at the first blank.&lt;/P&gt;
&lt;P&gt;I am trying to figure out what the editor does to it that changes its properties.&lt;/P&gt;
&lt;P&gt;The README.TXT files generated by VS can be read OK by the fortran library,&lt;/P&gt;
&lt;P&gt;but this one has some subtle difference that screws up the FORTRAN I/O.&lt;/P&gt;
&lt;P&gt;How may I get a HEX dump of the file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This file looks fine when I read it in with NOTEPAD or some other editor, but when&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 19:45:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972645#M97486</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T19:45:07Z</dc:date>
    </item>
    <item>
      <title>Now I CAN upload it, but</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972646#M97487</link>
      <description>&lt;P&gt;Now I CAN upload it, but could not before.&lt;/P&gt;
&lt;P&gt;Anyway, if I say:&lt;/P&gt;
&lt;P&gt;open(7,file="text1.txt")&lt;/P&gt;
&lt;P&gt;read(7,100)line&lt;/P&gt;
&lt;P&gt;100 format(A)&lt;/P&gt;
&lt;P&gt;It doesn't read the whole line in, if any blanks occur before the end.&lt;/P&gt;
&lt;P&gt;So sometimes during the process of editing it,&lt;/P&gt;
&lt;P&gt;it altered the properties of the file, but it is still&lt;/P&gt;
&lt;P&gt;editable from NOTEPAD or some other editor.&lt;/P&gt;
&lt;P&gt;Maybe a HEX DUMP would isolate the problem.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 19:50:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972646#M97487</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T19:50:50Z</dc:date>
    </item>
    <item>
      <title>Bill, I don't see the upload.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972647#M97488</link>
      <description>&lt;P&gt;Bill, I don't see the upload. I suggest a ZIP of your source and the file. I also didn't see any reaction to the note that your character variable was only 10 characters long. When you upload, be sure to click "Start Upload" after selecting the file.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 19:58:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972647#M97488</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-11-01T19:58:45Z</dc:date>
    </item>
    <item>
      <title>OK, here goes again.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972648#M97489</link>
      <description>&lt;P&gt;OK, here goes again.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:07:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972648#M97489</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T20:07:12Z</dc:date>
    </item>
    <item>
      <title>See what you get when you</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972649#M97490</link>
      <description>&lt;P&gt;See what you get when you write a 3 line fortran program. Does it trucnate any lines on your end?&lt;/P&gt;
&lt;P&gt;That first line has embedded blanks in it, it does truncate it on my end.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:10:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972649#M97490</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T20:10:10Z</dc:date>
    </item>
    <item>
      <title>That 10 character thing was</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972650#M97491</link>
      <description>&lt;P&gt;That 10 character thing was an oversight, yet some of the lines were more than 10 characters long, and it was returning line&lt;/P&gt;
&lt;P&gt;lengths shorter then 10 characters in some cases.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:11:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972650#M97491</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T20:11:00Z</dc:date>
    </item>
    <item>
      <title>CHARACTER(80) :: line</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972651#M97492</link>
      <description>&lt;P&gt;[fortran]CHARACTER(80) :: line&lt;BR /&gt;OPEN(7,file='text1.txt')&lt;BR /&gt;DO&lt;BR /&gt;&amp;nbsp; READ(7,100)line&lt;BR /&gt;&amp;nbsp; PRINT *, LEN_TRIM(line)&lt;BR /&gt;END DO&lt;BR /&gt;100 FORMAT(A)&lt;BR /&gt;END&lt;BR /&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;I don't see the behaviour you describe...&lt;/P&gt;
&lt;P&gt;[plain]&amp;gt;ifort /check:all /warn:all /standard-semantics readline2.f90&lt;BR /&gt;Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 14.0.1.139 Build 20131008&lt;BR /&gt;Copyright (C) 1985-2013 Intel Corporation.&amp;nbsp; All rights reserved.&lt;BR /&gt;&lt;BR /&gt;Microsoft (R) Incremental Linker Version 10.00.40219.01&lt;BR /&gt;Copyright (C) Microsoft Corporation.&amp;nbsp; All rights reserved.&lt;BR /&gt;&lt;BR /&gt;-out:readline2.exe&lt;BR /&gt;-subsystem:console&lt;BR /&gt;readline2.obj&lt;BR /&gt;&lt;U&gt;&lt;BR /&gt;&amp;gt;readline2.exe&lt;BR /&gt;&amp;nbsp;15&lt;BR /&gt;&amp;nbsp;1&lt;BR /&gt;&amp;nbsp;2&lt;BR /&gt;&amp;nbsp;3&lt;BR /&gt;&amp;nbsp;4&lt;BR /&gt;&amp;nbsp;5&lt;BR /&gt;&amp;nbsp;4&lt;BR /&gt;&amp;nbsp;3&lt;BR /&gt;&amp;nbsp;2&lt;BR /&gt;&amp;nbsp;1&lt;BR /&gt;&amp;nbsp;65&lt;BR /&gt;&amp;nbsp;33&lt;BR /&gt;&amp;nbsp;5&lt;BR /&gt;&amp;nbsp;4&lt;BR /&gt;&amp;nbsp;5&lt;BR /&gt;&amp;nbsp;12&lt;BR /&gt;&amp;nbsp;50&lt;BR /&gt;&amp;nbsp;50&lt;BR /&gt;&amp;nbsp;12&lt;BR /&gt;&amp;nbsp;11&lt;BR /&gt;&amp;nbsp;1&lt;BR /&gt;&amp;nbsp;10&lt;BR /&gt;&amp;nbsp;30&lt;BR /&gt;forrtl: severe (24): end-of-file during read, unit 7, file U:\projects\FortranMisc\2013-10-30 read-a-line\text1.txt[/plain]&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:38:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972651#M97492</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-01T20:38:10Z</dc:date>
    </item>
    <item>
      <title>Hang on - a line can be more</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972652#M97493</link>
      <description>&lt;P&gt;Hang on - a line can be more than ten characters and you will get a response less than 10, LEN_TRIM tells you the significant length of what's been read, not what was the original line.&amp;nbsp; If you have a line with&lt;/P&gt;
&lt;P&gt;[plain]123456789 ABCDEF[/plain]&lt;/P&gt;
&lt;P&gt;and you read it into a CHARACTER(10) variable, the variable will contain '123456789 ', where the last character is a blank. &lt;/P&gt;
&lt;P&gt;LEN_TRIM of that is then 9.&amp;nbsp; Trailing blanks are not counted.&amp;nbsp; That's independent of where they originally come from.&lt;/P&gt;
&lt;P&gt;Is that what you are referring to?&amp;nbsp; If so, and you want to count trailing blanks that were originally in the line, then you need to do things a little differently. &lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:43:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972652#M97493</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-01T20:43:05Z</dc:date>
    </item>
    <item>
      <title>I guess that was the problem.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972653#M97494</link>
      <description>&lt;P&gt;I guess that was the problem. So do you think I should just write a routine that will&lt;/P&gt;
&lt;P&gt;scan the line backwards and look for the first non-blank character?&lt;/P&gt;
&lt;P&gt;That's sure easy enough to do......&lt;/P&gt;
&lt;P&gt;with the text files I am working with, I don't care about trailing blanks anyway.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:56:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972653#M97494</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T20:56:00Z</dc:date>
    </item>
    <item>
      <title>program Console1</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972654#M97495</link>
      <description>&lt;P&gt;[fortran]program Console1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;implicit none&lt;BR /&gt;&amp;nbsp; &amp;nbsp;integer :: il, ierr&lt;BR /&gt;&amp;nbsp; &amp;nbsp;character(256) :: gchar &lt;BR /&gt;&amp;nbsp; &amp;nbsp;open(15,file='text1.txt',status='old',iostat=ierr)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;do while (ierr.eq.0) &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;read(15,'(A)',iostat=ierr) gchar &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;il=len_trim(gchar)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, il&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, gchar(1:il)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;enddo&lt;BR /&gt;&amp;nbsp; &amp;nbsp;pause&lt;BR /&gt;end program Console1[/fortran]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I did something similar, the output is in the screen capture attached. It seem to work just fine. you need to post the source you actually used in full and then the cause of the error can be seen.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 20:59:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972654#M97495</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2013-11-01T20:59:17Z</dc:date>
    </item>
    <item>
      <title>OK, I will try yours too -</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972655#M97496</link>
      <description>&lt;P&gt;OK, I will try yours too -&lt;/P&gt;
&lt;P&gt;Thanks for the input ! ! !&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 21:01:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972655#M97496</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2013-11-01T21:01:36Z</dc:date>
    </item>
    <item>
      <title>If you care about characters</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972656#M97497</link>
      <description>&lt;P&gt;If you care about characters past the first 10, then the variable you read the line into has to be long enough for the longest possible line. In typical applications I write for handling text files, I use 256 or 512 as the length.&lt;/P&gt;
&lt;P&gt;If you do that, then LEN_TRIM will do what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 21:03:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972656#M97497</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-11-01T21:03:44Z</dc:date>
    </item>
    <item>
      <title>You do not need to scan</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972657#M97498</link>
      <description>&lt;P&gt;You do not need to scan backwards len_trim does what you want. If you want to scan backwards you would need to declare the character to be longer than the longest line in the file and then fill it fully with blanks before the read each time otherwise there will be junk in the character string after the last character read potentially.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 21:05:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972657#M97498</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2013-11-01T21:05:19Z</dc:date>
    </item>
    <item>
      <title>No, you don't have to fill it</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972658#M97499</link>
      <description>&lt;P&gt;No, you don't have to fill it with blanks. The variable will be padded with blanks automatically if a shorter line is read.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 21:18:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972658#M97499</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-11-01T21:18:04Z</dc:date>
    </item>
    <item>
      <title>@steve Yes I stand corrected.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972659#M97500</link>
      <description>&lt;P&gt;@steve Yes I stand corrected. Formated internal read/write can leave junk issues though hence I have a habit of nulling character buffers, and ocasionally I must do this uncessarily out of habit/percieved safety..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 22:52:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972659#M97500</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2013-11-01T22:52:04Z</dc:date>
    </item>
    <item>
      <title>Bill,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972660#M97501</link>
      <description>&lt;P&gt;Bill,&lt;/P&gt;
&lt;P&gt;Is this the text file that produced the problems ?&lt;/P&gt;
&lt;P&gt;Attached is my trace of the file, which shows nothing unusual.&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2013 00:21:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/TXT-file-not-read-properly-by-Fortran-I-O-Why/m-p/972660#M97501</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2013-11-02T00:21:00Z</dc:date>
    </item>
  </channel>
</rss>

