X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06 Feb 2013 12:31 PM by  anon
Add string to float
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
06 Feb 2013 12:31 PM
    Hello, I have a float array that lists a number of wavelengths like this: 12345 12345 12345 I would like to concatenate this array with a list of strings before them in order to get the following result in a txt file or as a variable: Prairie1 12345 Prairie2 12345 Prairie3 12345 Can anybody help me? Cheers,

    Deleted User



    New Member


    Posts:
    New Member


    --
    06 Feb 2013 02:53 PM
    Hi there, What about this: IDL> a=12345 IDL> b="Prarie" IDL> c= STRING(a) IDL> print, b+c Prarie 12345 cheers, Fernando

    Deleted User



    New Member


    Posts:
    New Member


    --
    06 Feb 2013 03:12 PM
    Another option is the following, that looks closer to what you have: a=12345 c= STRTRIM(a, 1) b=["Prairie1", "Prairie2", "Prairie3"] n=n_elements(b) for i=0, n-1 do print, b[i]+' '+c Cheers! Fernando

    Deleted User



    New Member


    Posts:
    New Member


    --
    07 Feb 2013 03:34 AM
    That really helps me, Thank you very much!
    You are not authorized to post a reply.