Menu

system command to launch epstopdf

Help
2017-01-25
2017-01-25
  • John McOwen

    John McOwen - 2017-01-25

    Hello again,

    1) I am trying to launch a system command from a gnuplot script - and it only works partly. The function itself (epstopdf) is called but it doesn't seem to recognize the string in front of it (no file found). If I try to convert a file in the cmd-terminal it works fine (for example: epstopdf test.eps), but in the script the output is generated with a string function as follows:

    reset
    set terminal postscript eps size 10.0cm,6.0cm font "Helvetica, 16" enhanced color#16
    
    # field = gemessenes Feld + Verbindungsfelder (spez. Reihenfolge), seg = #Segmente, type = Mess-Typ (4P, Transferkennlinie, etc.)
    INPUT(field1,seg1,type1) = 'all_data_converted/Hex02_field'.field1.'_'.seg1.'seg_'.type1.'.txt'
    OUTPUT(field2,seg2,type2) = 'all_data_converted/'.type2.'_Hex02_field'.field2.'_'.seg2.'seg.eps'
    name(field3,seg3,type3) = type3.', Hex-Feld '.field3.' bei '.conn3.', mit '.seg3.' Au-Segment(en)'
    
    type = '4P'
    if(type = '4P'){
        set xlabel '(V)'
        set ylabel 'current (pA)'
        set xrange [-1.:1.]
    }
    
    if(type = 'trans'){
        set xlabel 'VGate (V)'
        set ylabel 'IDrain (pA)'
        set xrange [-1.:1.]
    }
    
    do for [field in '04_56 06_12']{
        if(field == '04_56'){seg = 1}
        if(field == '06_12'){seg = 2}
        set output OUTPUT(field,seg,type)
        print INPUT(field,seg,type)
        print OUTPUT(field,seg,type)
        plot INPUT(field,seg,type) u 1:2
        system('epstopdf '.OUTPUT(field,seg,type))#input file does not exist
        seg = 99
    }
    
    exit
    

    the eps-Output works, but epstopdf gives me an error (logfile says no file found).

    2) in the same script I tried to generate the output into a new folder. I tried to use

    outputdirectory = 'all_data_converted/Gnu-Out/'
    system('mkdir '.outputdirectory)
    

    but it didn't work - possibly for the same reason as above

    any help would be much appreciated
    have a nice day
    JMcO

     
  • John McOwen

    John McOwen - 2017-01-25

    just realized the if statements in the middle were faulty, == instead of = obviously (now I'm getting an error that a numeric expression was expected but never mind)

     
    • John McOwen

      John McOwen - 2017-01-25

      ok, apparently eq instead of ==, now at least this error's gone

       

      Last edit: John McOwen 2017-01-25

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.