r2 - 23 Nov 2007 - 13:48:58 - StianSoilandYou are here: myGrid wiki >  Mygrid Web  > TavernaWorkbench > TavernaFaq > FaqInputsFromFile

How do I load multiple inputs from a file?

When you read in a file by clicking Load inputs from the Run workflow dialogue it will be loaded as one single input, even if it contains multiple lines, ie. the workflow input will be a single string with many lines. You can actually select several files to add several inputs, each containing one or more lines.

Most services expects one input at a time, but your file contains several input values, one for each line. One way to get a list of inputs instead of a string with multiple lines is to add as a shim between the input to the workflow and where ever the input is destined, a little processor called Split string into string list by regular expression, found under Local Services -> Local Java Widgets -> text.

Connect the workflow input in question to the processor's string input, and for the regex input, right click and set default value to \n (that's backslash n) - which means newlines. You could try \r\n instead if your files are Windows based and \n is causing you problems. If your file consists of lines of columns you can try to add a second splitter and split by space, \t tabulator or similar.

Connect the split output to the rest of the workflow instead of the original workflow input. (Remove the old connection).

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by myGrid wiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding myGrid wiki? Send feedback