I've got the following two dimensional array of ASCII characters:
1st row: a(1,1)=A, a(1,2)=B, a(1,3)=C, a(1,4)=D, ...
2nd row: a(2,1)=a, a(2,2)=b, a(2,3)=c, a(2,4)=d, ...
3rd row: a(3,1)=!, a(3,2)=", a(3,3)=#, a(3,4)=$, ...
...
For further processing, I would like to pack them into a one dimensional array elements as follows:
b(1)<=a(1,:)=ABCD...,
b(2)<=a(2,:)=abcd...,
b(3)<=a(3,:)=!"#$...,
...
It cannot go directly like this because arrays b(:)
and a(:,:)
are of different types
In particular, I would like have to some suggestions
for --???-->
for the do loop below
do j=1,n
if (some condition) then
a(:,j) --???--> b(j)
end if
end do
(b(j)
might by a blank (" ", ASCII 32), provided
a condition excludes it.)
I can easily print out the strings as follows
do j=1,n
if (condition which excludes the 2nd row) then
print *, a(j,:)
end if
end do
The output is:
ABCD...
!"#$...
.......
but that is not what I need. What I need is b(j)
for further processing.