Hi Mark is right you can use some tcl to test that your input exists, and if not do somthing like aborting the translation
but I think that I would use the INCLUDE [ script ] syntax rather than the FME_BEGIN_TCL, as I am not shure you would get rid off an dialog if you use the last expresion FME_BEGIN_TCL is executed before any translation but after the mapping file are parsed, where as the INCLUDE [..] is executed while the parsing takes place, and if you want to get rid off an dialog then you have to stop before getting to that dialog in the mapping file but both commands are extremy poverfull and let you do all kinds of testing, preprocessing and dynamic rewriting off the mappingfile, and to know these commands make it fun to write mapping files as thy add a more dynamic and flexible dimension to the script Peter >From: "mark2atsafe" <[EMAIL PROTECTED]> >Reply-To: [email protected] >To: [email protected] >Subject: [fme] Re: CSV Reader, translation parameter error message trapping >Date: Mon, 05 Feb 2007 17:26:31 -0000 > >Hi Marc, >I'd use a pre-translation TCL/Python script to test for the files. >The fragment of TCL code I would use to test for file existence is... > >if {![file exists $inputFilename]} { > error "File does not exist" >} > >...the error command will both write to the log file (I think) and >cause the FME translation to be terminated (I know). > >To use this code within a mapping file (which you seem to be using) >add the line... > >FME_BEGIN_TCL <tcl script> > >...where <tcl script> is the path+name of a TCL script. > >In FME2007 you can embed the script into the mapping file - but it's >not simple (unless you use Workbench)... > >FME_BEGIN_TCL FME_Decode ><lf>if<space><opencurly>!<openbracket>file<space>exists<space><dollar>inputFilename<closebracket><closecurly><space><opencurly><lf><tab>error<space><quote>File<space>does<space>not<space>exist<quote><lf><tab><closecurly> > > >Anyway, this fmepedia page will give you more information... >http://www.fmepedia.com/index.php/Category:TCL_Pre_Post_Processing_FAQ > >Hope this helps, >Regards, > >Mark > >Mark Ireland, Senior Product Specialist >Safe Software Inc. Surrey, BC, CANADA >[EMAIL PROTECTED] http://www.safe.com >Solutions for Spatial Data Translation, Distribution and Access > >--- In [email protected], "m_lem3" <[EMAIL PROTECTED]> wrote: > > > > Hello to all, > > > > Is there a way to avoid a GUI prompt when an CSV input file is missing? > > > > Example: > > GUI IGNORE > > SourceDataset_CSV_1,_SKIP_LINES_CSV_1,_STRIP_QUOTES_CSV_1,_DUPLICATE_DEL > > IMS_CSV_1 > > DEFAULT_MACRO Liste_fichiers_MNAQuebec > > X:\Travail\IMR\PRO\Inventaire_MNE\list.txt > > INCLUDE [ if {{$(Liste_fichiers_MNAQuebec)} == {}} { puts_real > > {Parameter Liste_fichiers_MNAQuebec must be given a value on the > > commandline.}; exit 1; }; ] > > > > What would be nice is the possibility to replace : puts_real {Para... > > by logging an error in the log file and then terminating the > > application. > > > > Marc > > > > _________________________________________________________________ Opret en personlig blog og del dine billeder på MSN Spaces: http://spaces.msn.com For insights into what's up at Safe Software and what's on the development horizon, visit Safe's blog at spatial-etl.blogspot.com. Safe Software has also made slides available that outline enhancements planned for FME 2007. The slides are from the "Road Ahead" presentation given on Day 2 of the FME Worldwide Users Conference. To view these slides, visit www.safe.com/2006uc. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/fme/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/fme/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
