Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

joining 2 strings

Status
Not open for further replies.

vibhava

Programmer
Apr 20, 2008
19
US
hi,
I am trying to join two strings and facing a strange problem. My codes are:

Program Read_result
Implicit None
character*6::d,filename
character*19::file
Integer::c,e
c=1
write(d,'(I1)') c
filename = 'run'//d
file='\reach000034_33.csv'
open(18,file='C:\WAMView\bnz\WAMSA\'//filename//file)

I want to get a string:

file='C:\WAMView\bnz\WAMSA\run1\reach000034_33.csv'

so that later in my program i can use this string to open desired files. The program was compiled without error however, on running it is giving an error because on running it this is what it is reading:

file='C:\WAMView\bnz\WAMSA\run1 \reach000034_33.csv'

note the space before "\reach000034_33.csv" i think the error is because of that. please advise how to remove this space.

could anyone help me handling this problem. Any help would be appreciated.

thanks

vibhava

 
Use the trim function before concatenating
Code:
'C:\WAMView\bnz\WAMSA\'//trim(filename)//trim(file)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top