<?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 Text File Duplication in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801399#M37896</link>
    <description>Arjen,&lt;BR /&gt;&lt;BR /&gt;Ipackagedmy testproject, let me know if you can't open a zip file. I used 7zip to create this file.I am building this project with MSVS 2008 and Intel Visual Fortran Composer XE 2011.&lt;BR /&gt;&lt;BR /&gt;The problem area is in the Function SAVE_FILE_DATA, if you add a couple of break points at line 289 and 327 you will be able to see what is happening in the file. I use notepad++(free) to view the file while the program is running. File is perfect until I call the CLOSE function and it adds an extra line.&lt;BR /&gt;&lt;BR /&gt;Please note that the test file has two blank lines at the end, there will be three after running the test.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help and good luck,&lt;BR /&gt;Bob</description>
    <pubDate>Thu, 23 Jun 2011 15:10:23 GMT</pubDate>
    <dc:creator>Robert_Middleton</dc:creator>
    <dc:date>2011-06-23T15:10:23Z</dc:date>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801397#M37894</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to write some code to:&lt;BR /&gt;&lt;BR /&gt;1) open a text file, &lt;BR /&gt;2) save the contents to memory, &lt;BR /&gt;3) and overwrite the contents back to the same file.&lt;BR /&gt;&lt;BR /&gt;I am able to perform all 3 steps except for one thing, when I close the file it adds one extra blank line to the end of the file. Not really a huge problem if you only open the file one time, but if you open the same file 1000 times it's going to become a problem.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;This is how I am opening the file:&lt;BR /&gt;&lt;/STRONG&gt;&lt;P&gt;OPEN (file=c_file_name_and_path%string_data, status='unknown', &amp;amp;&lt;BR /&gt;access='sequential', form='formatted', iostat=i_status, &amp;amp;&lt;BR /&gt;NEWUNIT=file_unit_number)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;This is how I am writing out the data to the file if the line is blank: ADVANCE='NO'&lt;BR /&gt;&lt;/STRONG&gt;WRITE (UNIT=filedata%file_unit_number, FMT='(A)', ADVANCE=adv_switch, ERR=9999)&lt;BR /&gt;&lt;STRONG&gt;or if the line has data&lt;BR /&gt;&lt;/STRONG&gt;WRITE (UNIT=filedata%file_unit_number, FMT='(A)', ADVANCE=adv_switch, ERR=9999) &amp;amp;&lt;BR /&gt;file_line%string_data(index:index)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;At the very end:&lt;BR /&gt;&lt;/STRONG&gt;CLOSE (UNIT=filedata%file_unit_number)&lt;BR /&gt;&lt;BR /&gt;Please let me know if you need anything else.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bob&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 20:17:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801397#M37894</guid>
      <dc:creator>Robert_Middleton</dc:creator>
      <dc:date>2011-06-22T20:17:48Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801398#M37895</link>
      <description>Can you show us a (small) program that exhibits this behaviour?&lt;BR /&gt;I first thought it had to do with line endings (UNIX-style line endings or&lt;BR /&gt;the last line of the file not being finished with a line ending, but that&lt;BR /&gt;is not going todo it.&lt;BR /&gt;Your description of the process may be accurate, but my guess is &lt;BR /&gt;that there is some detail you have not got quite right.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 23 Jun 2011 09:32:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801398#M37895</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T09:32:17Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801399#M37896</link>
      <description>Arjen,&lt;BR /&gt;&lt;BR /&gt;Ipackagedmy testproject, let me know if you can't open a zip file. I used 7zip to create this file.I am building this project with MSVS 2008 and Intel Visual Fortran Composer XE 2011.&lt;BR /&gt;&lt;BR /&gt;The problem area is in the Function SAVE_FILE_DATA, if you add a couple of break points at line 289 and 327 you will be able to see what is happening in the file. I use notepad++(free) to view the file while the program is running. File is perfect until I call the CLOSE function and it adds an extra line.&lt;BR /&gt;&lt;BR /&gt;Please note that the test file has two blank lines at the end, there will be three after running the test.&lt;BR /&gt;&lt;BR /&gt;Thanks for the help and good luck,&lt;BR /&gt;Bob</description>
      <pubDate>Thu, 23 Jun 2011 15:10:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801399#M37896</guid>
      <dc:creator>Robert_Middleton</dc:creator>
      <dc:date>2011-06-23T15:10:23Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801400#M37897</link>
      <description>&lt;P&gt;Hi Bob,&lt;BR /&gt;&lt;BR /&gt;I have the zip-file and I will try and have a look tonight. Can't promise anything, but it is one of&lt;BR /&gt;those things that keep nagging :).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2011 15:41:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801400#M37897</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T15:41:43Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801401#M37898</link>
      <description>Hi Arjen,&lt;BR /&gt;&lt;BR /&gt;I'm sorry, I was beinglazy sending you the entire project, plus you will have all sorts of issues with file paths so I have written a very simple program that demonstrates the issue.&lt;BR /&gt;&lt;BR /&gt;Basically, I open a file and write a couple of lines to it. When I call theCLOSE function it will add one more line to the file that I do not want.&lt;BR /&gt;&lt;BR /&gt;Thanks for looking,&lt;BR /&gt;Bob&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2011 16:08:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801401#M37898</guid>
      <dc:creator>Robert_Middleton</dc:creator>
      <dc:date>2011-06-23T16:08:03Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801402#M37899</link>
      <description>I had a quick look and your use of allocatable-length strings may inhibit my running the program,&lt;BR /&gt;but I suggest you have a thorough look at the reading routine. That might be one possibility for the &lt;BR /&gt;cause of the problem.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 23 Jun 2011 16:11:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801402#M37899</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T16:11:26Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801403#M37900</link>
      <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;I will have a look at that much simpler code :)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 23 Jun 2011 16:13:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801403#M37900</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T16:13:44Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801404#M37901</link>
      <description>Are you sure?&lt;BR /&gt;&lt;BR /&gt;I tried with Intel Fortran 12 and gfortran on Linux: nothingextra&lt;BR /&gt;I also tried with Intel Fortran 11 on Windows: nothing extra either (not counting the CRs)&lt;BR /&gt;&lt;BR /&gt;I do not have ready access to Intel Fortran 12, so can't test that.&lt;BR /&gt;Odd, very odd.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 23 Jun 2011 16:19:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801404#M37901</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T16:19:49Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801405#M37902</link>
      <description>Arjen,&lt;BR /&gt;&lt;BR /&gt;A little more information about my system, I am running Windows 764bit.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Bob</description>
      <pubDate>Thu, 23 Jun 2011 16:41:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801405#M37902</guid>
      <dc:creator>Robert_Middleton</dc:creator>
      <dc:date>2011-06-23T16:41:57Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801406#M37903</link>
      <description>Hi Bob,&lt;BR /&gt;&lt;BR /&gt;that should not really matter. At least I hope so. I have no Windows 7 machine at hand&lt;BR /&gt;right now, so I hope someone else can step in. In the meantime it does remain bizarre.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 23 Jun 2011 16:44:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801406#M37903</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T16:44:50Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801407#M37904</link>
      <description>&lt;P&gt;Arjen,&lt;/P&gt;&lt;P&gt;On my Windows 7 machine, I have a XP virtual machine installed. In XP I have our old Lahey compiler installed, when I compile and run the code, no extra line ;-). I think Intel has a bug and I am going to report it. Thanks for helping by running the same code on some other systems and thanks again for taking the time to look at my problem, I appreciate it.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2011 16:57:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801407#M37904</guid>
      <dc:creator>Robert_Middleton</dc:creator>
      <dc:date>2011-06-23T16:57:08Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801408#M37905</link>
      <description>You're welcome :)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Thu, 23 Jun 2011 16:58:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801408#M37905</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-06-23T16:58:41Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801409#M37906</link>
      <description>I don't see a bug. If you open the file in a text editor, yes, the editor will present it as three lines but there are really only two. If you look at the file with a binary editor, you will see the second line properly ending with a CR-LF delimiter and there is nothing after that. Notepad, etc. will position the cursor on the yet-to-be-created third line.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.intel.com/skins/images/7B13F55A7CE623EF42E69096FA81A3A1/2021_redesign/images/image_not_found.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 23 Jun 2011 17:17:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801409#M37906</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-06-23T17:17:07Z</dc:date>
    </item>
    <item>
      <title>Text File Duplication</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801410#M37907</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;I agree, the simple code sampleI submitted is not doing what the larger program does. Please see the attached file "input.dat." If you look at it with yourbinary editor you will see a sequence of 4 "0D 0A" entries at the tail end of the file. This is from running my larger program 4 times.The entire projectfor this program was submitted in a zip file in an early post. I am unable to produce a simpler example thatdemonstrates the issue.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bob</description>
      <pubDate>Thu, 23 Jun 2011 20:05:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Text-File-Duplication/m-p/801410#M37907</guid>
      <dc:creator>Robert_Middleton</dc:creator>
      <dc:date>2011-06-23T20:05:34Z</dc:date>
    </item>
  </channel>
</rss>

