Re: zipcode selection sort in MR&C
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: zipcode selection sort in MR&C         

Group: comp.lang.fortran · Group Profile
Author: glen herrmannsfeldt
Date: Aug 19, 2008 19:06

Ron Ford wrote:
(snip)
> read (2, '(/a/a/a2,i8)',end=10) data_array(i)

I don't think this format can read the file the
way you want it read.

To start, the initial / will skip the first line.

Next, you should have four A descriptors
to match the four CHARACTER variables.

Third, the third A will read in the city, state, and zip
leaving nothing when it gets to reading the zip in I8 format.

The read will fail and on most systems will print a
message telling you that it failed.
> Addresses.txt is exactly:
> T. Boone Pickens
> 350 Swiftboat Lane
> Houston, TX 45536
>
> Ev Bayh
> 1016 Humdity Bath
> Indianapolis, IN 47250
>
> Cindy McCain
> 1000 Richie Rich
> Scottsdale, AZ 85250
>
> Diane Feinstein
> 250 Harvey Milk Circle
> San Fransisco, CA 96580
>
> Tim Pawlenty
> 500 Olson way
> St. Paul, MN 56674
>
> Donald Trump
> 100 Trump Plaza
> New York, NY 10080
>
> Output.txt is:
>
> after sorting
> 99 0

-- glen
no comments
diggit! del.icio.us! reddit!