> I am looking for a tool to compare A N D merge two files, e.g. two
> F90-sources.
> In the past we used a commercial tool of hp called "softbench". This pack=
> age
> includes a program "softcom", which gives a side-by-side view of the two
> files.
> Then you can merge the two files into a new one. Thereby you can decide f=
> or
> every line whether to use the left, the right or both lines. This is very
> helpful to maintain a program by two or more persons in parallel.
> Unfortunately hp does not support softbench for F90 so we no longer use t=
> his
> tool.
Maybe I'm missing something, but it seems easy enough to write a code
which reads both files, line by line, displays them on the screen, and
asks you which line to write to a third file.
PROGRAM MERGE
IMPLICIT NONE
! flesh out according to taste
INTEGER :: ANSWER, STATUS
CHARACTER (LEN=132) :: LINE1, LINE2
OPEN (10, FILE='1')
OPEN (20, FILE='2')
OPEN (30, FILE='OUTPUT')
DO
READ (10, '(A)',IOSTAT=STATUS) LINE1
IF (STATUS < 0) EXIT
READ (20, '(A)') LINE2
PRINT*, '1: ', LINE1
PRINT*, '2: ', LINE2
WRITE (*, '(T2,A)', ADVANCE='NO') '1 OR 2?'
DO
READ*, ANSWER
SELECT CASE (ANSWER)
CASE (1)
WRITE (30, '(A)') LINE1
EXIT
CASE (2)
WRITE (30, '(A)') LINE2
EXIT
CASE DEFAULT
PRINT*, 'PLEASE ENTER 1 OR 2'
END SELECT
END DO
END DO
CLOSE (10)
CLOSE (20)
CLOSE (30)
END PROGRAM MERGE
I admit that this is slightly tongue-in-cheek, since I assume the tool
does more, and can't see why one would use BOTH lines---a line by line
comparison would only make sense if the lines somehow correspond.
Still, based only on what you've said, this should fill the bill. :-)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|