URGENT: Choosing target directory according to file name.
Hi
I have a requirement for transfering a file to the directory according to the filename.
Example
If the file name is
FIABC it should be moved to directory DI_ABC in the target server and if it is
FIXYZ it should be moved to directory DI_XYZ.
No mapping is involved in this case .
Do we have some other way around than variable substituion
Regards
Abhishek mahajan
Hi,
For this we have to configure Two Communication Channels one for one Location and the other for other location.
Use X-path concept in Interface Determination and call the corresponding inbound Message Interface and Interface Mappings based on the condition
1) Create Two Inbound MI's
2) Create One MM
3) Create 2 Interface Mappings
4) Create 2 Receiver CC and One Sender CC
5) Create One Receiver Det
6) Create 2 Interface Det
7) Create One Sender Agreement
8) Create Two Receiver Agreements
Regards
Seshagiri
Similar Messages
-
Determine Target directory from Source file names with out mapping
Hi All,
I have a requirement to determine the Target Directories from the Source file names.
File Sender Adapter - XI - File Receiver Adapter
In this scenario I am not doing any mapping. Source File directory contain 3 files. These file should go to 3 directories in the Target Server.
Please help me how can meet this requirement
Thanks in advance
KevinHi Kevin,
if you can separate the files by name. have 3 sender communication channels each picking up one of the files (you do this by making the regex in the file name mutually exclusive) and then send them all to the target system using the same comm. channel.
regards,
Horia -
Insert a directory path and file name option
I built a program that runs three tasks when a voltage triggers the data acquisition. I would like now to insert an option/control for two issues: selection of the directory where the data will be saved, and selection of the file name. How can I do this such that after I press 'start' I should be asked which is the directory where I want the data to be saved and then what is the file name?
Another option would be the following: After I press 'Start' I will have a control where I can write or browse for the folder where I want to save the data; then I have another controller where I write the new file name. So in this case I should not be prompted except the case when I am trying to use the same file name.
Where should I con
nect this new subvi in my loop - before the tasksand before the trigger, or after the tasks and before the trigger?
Thank you.Programming with LabVIEW might be fun but it is quite time consuming�
OK, here is what I want to do.
I have to monitor a machining process. I have to record cutting forces, power consumed, vibrations, and temperature. From each of these sensors I get a voltage as output and I used �Measurement and automation� and NI-DAQmx to program my tasks (I have LabVIEW Express running in Windows XP).
The triggering of DAQ is generated by the input of a 4.5V DC when the CNC program starts; the stop occurs when CNC program ends and the output voltage becomes 0V. I have finished all the connections and now I have to build the vi.
The �small picture� could be described this way:
I want to record the parameters and save them in files that I could process later using specific vi.
The �big picture� would be the following:
I would like to build a stand alone program that will do the following: when I run the program [ i. e. double-click the shortcut (or the file)] a panel should come up in the center of the screen � in this panel I would like to be able to select what process am I going to investigate: grinding, turning, milling, drilling, tapping etc.
Once I selected what process I am going to investigate, the front panel of a vi should come up � In this panel I should be able to select what parameters I am going to record: forces, power, vibrations, and temperature. On the front panel I should be able to see the waveform of the acquired data. A start/stop button and a led green/red for each parameter should show me the status of the acquisition (green is on, red is off). The start/stop button should allow me to �manually� start or stop the program at any time. Additionally, on the front panel I should also have icons with a choice for directory (folder) path, file name, and comments regarding the experiment. The date and time should be recorded in the file that is saved. There should be an option (check box or selection icon) for saving the data in binary or ASCII format.
Similar to any program, the front panel should have a toolbar containing File, Operate and Help options. The File option should contain �Clear graphs�, �Setup DAQ� and �Exit� and the Operate option should contain: Use digital alarm, Use digital trigger, and Write data to disk with the option to be selected or deselected. The main front panel should close when I select File -> Exit.
The File -> Setup DAQ selection should bring up another front panel in which I should be able to see the acquisition control panel (device, channels to get, buffer size, units � English or metric) and the calibration factors (for the tasks, including triggering voltage) including sampling rate.
Well, that�s almost all. I understand I cannot do this all at once. Unfortunately, I have a very close due date in getting the system up and ready. I am hoping that I could get some help setting up a simple program and I could develop the rest step by step later...
Can anybody help me with this program? I have attached a first attempt that would allow automatic triggering and stopping as well as displaying of forces, power and acceleration.
Thank you in advance.
Radu
Attachments:
Acq_Graph_Voltage-Int_Clk-Dig_Start_Ref_TRIAL1.vi 201 KB -
Batch Folder renaming according to file name.
Hi,
I work in a busy photostudio and I am currently using automator to process thousands of Images, compression, size, name changes ect. However there is just one process I am stuck on. I need to put these Images into folders that relate to the file name. I have a process that will do this that I found here. This works well but i need it to only look at a certain part of the file name.
For example if I had a collection of images like this,
azz55412_blue_3.jpg
azz55412_pink_2.jpg
azz55412_blue_6.jpg
azz78459_blue_1.jpg
azz78459_blue_3.jpg
azz65236_blue_7.jpg
The current process would place each one in a folder named after each image. Ideally I would like it to only look at the first part of the name ie azz55412 and create a folder called that and place any other images it finds with the same code in that folder.
Is this possible with automator or applescript?
Any help or suggestions would be appreciated!
Thanks,
MarkSave the line below into a plain text file and give it the .jsx extension.
app.activeDocument.activeLayer.name = decodeURI(app.activeDocument.name).match(/(.*)(\.[^\.]+)/)[1];
Then create an action that runs that script. Then run File-Automate-Batch using that action. -
How to automatically rename tracks according to file name
Hi all,
this is probabaly a very simple fix but for some reason its foxing me today,
in CS6 when importing multiple audio files, is there a way of automatically naming the tracks the same as the file name.
eg if the file is labeled 'snare.wav' and you import it into Track 1, then the track is then renamed 'snare'
thanks.Thanks for the reply Steve, I understand the implications your refering to, I just wondered if there was an option to turn this on if required, so for instance if i am importing 70 or so audio files i dont have to go through and name each track one by one.
something similar to the 'Use Audio File Name as Track Name' option in Logic would be useful.
regards -
Create Folder according to file names
Hello, I've been trying to do something "I thought" would have been very simple to do with Automator but with no success so far.
Work required: I have a single folder (let's call it Root) that contains a lot of files (note there are only files, no subfolders under Root). I want to make a workflow that will create a separate folder within Root based on each file's filename and the respective files will be moved into this folder (note just the filename, no extension.)
Example: Say I have 2 files in Root right now - ABC.zip and XYZ.avi. After I run Root through the workflow, 2 folders will be created within Root, called ABC and XYZ, containing ABC.zip and XYZ in each folder, respectively. There will be no more files within Root but subfolders.
I tried a few times but not sure how I can get the filename of each file and create a folder accordingly. Thanks for the help!!Yes, It works like a charm.
Still, I have some questions how to alterate.
I have a library of movies that I unfortunately have in this way:
ABC
Adulthood.avi
Adulthood.jpg
Apocalypto.avi
Apocalypto.jpg
When I start the script it runs perfect until it comes to Adulthood.jpg and can not go on because the folder with that name already excist.
I would like to change the script so that it goes through all files with a certaing extension and moves all files with the same name (no matter what extension it has)
Does anyone know how to do this change in the script?
The best thing would be to be able to write something like this:
(file extension: .avi;mpg;mpeg;mkv etc)
/Anders -
Dynamically deciding the target directory without ESR objects
Hi Experts,
I have come across File to File scenario(NFS) where I have to serve 2 purpose in one scenario using single receiver communication channel as the client have more than 40 plants.
1. I need to copy the file from source directory to target directory without creating the mapping objects.
2. based on source file name the target directory path will be the 'target directory + First 4 character of source file name i.e.(Plant name)'.
I am able to achieve the First requirement, can any one tell me how to achieve Second requirement.
Thanks in advance.
Ragards,
GopiHi Inaki Villa/ Anupam Ghosh,
Thanks for your previous reply. I was busy with some other WS related task.
I have gone through the thread which uses java code to dynamically set the Target Directory.
'Dynamic file name for pass-through scenario - Process Integration - SCN Wiki'.
But the mentioned JAR files are not available on our clients PI System (PI 7.0) I tried by importing the required JAR files from other system but it was giving some error. So I decided to go with ABAP Mapping and I am quite successful in setting the target directory. I am able to view the Target Directory and Target File name in 'DynamicConfiguration' in SXMB_MONI.
But it is not over writing the 'Target Directory' path mentioned in Receiver Communication Channel.
Could you please help me in this? Do I need to set anything else?
Regards,
Gopi -
Unable to convert the file name in Target directory
Dear Experts,
Currently iam facing a problem with some files.my interface is a File to file .As per the interface the sender will pick the flatfiles from source directory which the file name was BNP_NE201.txt once my file reached to target directory the name of the file willrenamed as VENDOR_Payment.NE201 automatically for this they have done some OS level script in receiver communication channel of the first interface which we have added "un operating system command after message processing" in processing parameters tab.again one more sender comm channel wil pick the file from first target directory which is having naming convesion of "VENDOR_Payment.NE201 " and post it to target. all the two interfaces are file to file (NFS) . for a parctuclar day files has been posted to 1 st target directory and the receiver communication channel is not yet convert the file names bcz of that the second communication channel can't able to pick the files from target directory. for some times that is working fine and some times it is unable to convert.
from our side i check every thing .could you please suggest me the way to approch
Reagrs,
Kiran tanuku>> for a parctuclar day files has been posted to 1 st target directory and the receiver communication channel is not yet convert the file names bcz of that the second communication channel can't able to pick the files from target directory. for some times that is working fine and some times it is unable to convert.
You need to wait until the file is converted. After when it is converted then the second interface sender communication channel will pick the files.
What do u mean by unable to convert?
Is it unable to do the content conversion? if so then check the data as you said that it sometimes it works fine.
> The best approach is to change the name of the file in the receiver communciation channel instead of using a script.
Thanks, -
Target file name using Dynamic Configuration
Hi,
Currently we have requirement Idoc to File interface.In this scenario if one field exists infile then we have to check and we need to create update directory and if it is not exist then we should create one more directory and upload files over there there files should create with timestamp. Since,File system using Sql database so we have used JDBC lookup to check that particaluar field and if it exists we are passing update to UDF if it is not then we are passing constant Create to that. If we use Adapter Specific Message Attributes then in reciever side file Communication Channel addtimestap will it consider or do we have to write anything in Udf it self? Could anybody explain on this?Please provide some sample udf .
Thanks ,
Aparna.
Edited by: aparna_karnam on Dec 24, 2011 11:44 AM
Edited by: aparna_karnam on Dec 24, 2011 11:52 AMHi,
I have added little changes to the code you have written, to meet your expectations
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key,"/sap-dev/" +a);
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
string filename=conf1.get(key1);
final String DATE_FORMAT_NOW = "dd-MM-yyyy_HH-mm-ss";
String s;
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT_NOW);
java.util.Calendar cal = java.util.Calendar.getInstance();
s=sdf.format(cal.getTime());
filename=a+" "+"User_"+s+".txt";
conf1.put(key1,filename);
return " ";
So if value of input variable "a" is "update" then the target directory will be "/sap-dev/update" and the file formed will have name "update User_26-12-2011_01-20-50.txt", of course the date and time values will change depending on server settings. I just showed a sample. one more point, the directory will not be created, you have to create the directories before you run the scenario, only the final directory will be decided depending on value of variable "a". In case you wanna create new directory if directory is not pre-existing then try ticking on "Create Target Directory" option under "file access parameters" in communication channel. (I have never used this option u can have a try. )
Now coming to your queries
1. But whether file type txt automatically it will take or do we have to give in udf it self ?
ans) You have to put the value in UDF as I have done in code.
2. how it will consider timestamp ?
ans) This has been generated in UDF itself.
3. how i can give file extension .txt?
ans) same as ans 1
4. And also in Receiver Communication Channel under Adapter Specific Message attributes we have option of file type how it works?
ans) File type determines is the file you are going to write is of type "text" or "binary". From "Processing Parameters" tab you can select this from drop down menu in communication channel or you can set it through ASMA properties in similar manner as you have done for file name and directory name. For more details refer to http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/content.htm
Finally few more points I would like to add
1) you have not mentioned the operating system of the server where file is going to form. In case its UNIX/LINUX you are not allowed to use space in the filename. you can consult these links before you decide on file name and directory name in the UDF mentioned above
http://www.med.nyu.edu/rcr/rcr/nyu_vms/unixfileanddirectorynames.htm (UNIX)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions (WINDOWS)
2) you can alter the string "DATE_FORMAT_NOW" as per your requirement so that the timestamp appears in the way you want. I have just showed a sample.
3) Plesae do not forget to tick on the options "Use Adapter-Specific Message Attributes indicator", "Fail If Adapter-Specific Message Attributes Missing", indicators "File Name" and "Directory" under "Define Adapter-Specific Message Attributes." in receiver communication channel.
Hope this solves your problem.
Wish my dear forum members and users of SDN
Merry Christmas and Happy new year (in advance)
Regards
Anupam
N.B:- I initially forgot to add the ".txt" part to the file name. I made necessary corrections in code now. -
CiscoWorks Shadow Directory File Name After Device Rename
I have noticed that when a Device is renamed through Common Services --> Device and Credentials --> Device Management --> Edit Identity, it does not rename the config archive file name in the shadow directory. Changing the Display Name, Host Name, and IP Address for Device Properties. All of our devices are named with the IP Address of the device so we have the IP Address for the Display Name, Host Name, and IP Address.
Example: Device with the name of 10.10.10.10 has a config archive in the shadow directory with the file name 10.10.10.10.cfg. When the device is renamed to 10.10.10.20 it still continues to config archive ok but keeps the file in the shadow directory as 10.10.10.10.cfg.
Is there a way to get the config archive shadow directory file name to change?
Thanks.Hi.
Kindly try resubmitting Device under RME (RME ->Device management -> Normal Device ->Select that particular Device and click on resubmit) and once it is back to normal state, then try to collect Archive after performing any change on the Device and see if it updates the Name of the Device under Shadow Directory.
If above steps does not help, you need to delete and re add Device under Common Services --> Device and Credentials --> Device Management in order to get the correct name reflect under Shadow Directory.
Kindly let me know in case you have any doubts regarding the same.
Thanks & Regards,
Nikhil -
Receiver File adapter: dynamic folder name based on file name
Hi there,
is it possible to set up one communication channel that will use different target folders based on file name?
E.g.
File abcdef will be saved to /root/abcdef/abcdef or /root/abcdef/abcdef.txt
File xyz will go to /root/xyz/xyz or /root/xyz/xyz.txt
I know I could use Sender/Receiver Service, Interface/namespace or data from message for variable substitution but could not find an easier solution for this scenario than to create multiple communication channels.
Thanks.If you haven't a message mapping, then you can create only an interface mapping with an abap mapping.
In your abap mapping:
DATA l_record type mpp_dynamic.
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'FileName'.
l_record-value = "your filename"
dynamic_configuration->add_record( l_record ).
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'Directory'.
l_record-value = "your directory ".
dynamic_configuration->add_record( l_record ).
Afther that, you must activate Adapter Specific Message Attributes (directory and/or filename) in your target communication channel .
Regards,
Carme. -
Decide target directory dynamically.
Hi All
I need to configure a receiver communication channel with file adapter. Important thing is target directory need to be decided dynamically based on some content in the message. Please let me know what are the possibilities to achieve this.
Thanks & Regards
Shantha
Edited by: Shantha Bandara on Feb 12, 2008 1:05 AMHi Shantha,
Create UDF in that you derive directory name and/or file name based on message content and store them in Dynamic Configuration.
When you are giving Directory name just give generic name from UDF(from the following code in place of directory name just give %Directory% File name %FileName%).
Here the sample value UDF code
AbstractTrace trace = container.getTrace();
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fnam = conf.get(key);
String dir = <Path to directory>;
String newfnam = <File name>;
conf.put(key,newfnam);
key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key,dir);
return("");
Please let me know if you have any issues.
Cheers,
Jag -
Importing text file (with file names) into Automator.. is it possible?
Hello all,
I have been working with Windows Batch files for my line of work. I have a couple of file names in a text file (a column), which I want to copy from one folder of one hdd to another folder on a different hdd. I have been trying to do this kind of work with a Mac. I already know how you copy and rename files in automator (which isn't difficult, of course) but you have to 'select' the files in the finder first (with get specified items).
But the only way i see that you can specify items is by selecting them... is there a way to import a text file with all the file names instead of selecting all the file names manually?
or is there an AppleScript alternative which I can use to import the text file (or just copy into applescript) and run before the query's of copying and renaming the files? I am kind of new to Apple programming.
The text file looks like this:
image1.jpg
image2.jpg
etc..
so there has to be a command to: 'goto' a specific folder as well.
Thanks in advance!You can import text files, but if they are just names you will need an additional action to add the source folder path. A *Run AppleScript* action can be used, for example:
Tested workflow:
1) *Ask for Finder Items* {Type: files } -- choose the text file containing the names
2) *Combine Text Files* -- this gets the text file contents
3) *Filter Paragraphs* { return paragraphs that are not empty } -- skip blank lines
4) *Run AppleScript* -- copy and paste the following script:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 680; height: 340px;
color: #000000;
background-color: #FFEE80;
overflow: auto;"
title="this text can be pasted into an Automator 'Run AppleScript' action">
on run {input, parameters} -- add folder path
add the specified folder path to a list of file names
input: a list of text items (the file names)
output: a list of file paths (aliases)
set output to {}
set SkippedItems to {} -- this will be a list of skipped items (errors)
set SourceFolder to (choose folder with prompt "Choose the folder containing the file names") as text -- this is the folder containing the names
repeat with AnItem in the input -- step through each name in the input
try
set AnItem to SourceFolder & AnItem -- add the prefix
set the end of the output to (AnItem as alias) -- test
on error number ErrorNumber -- oops
set ErrorNumber to (" (" & ErrorNumber as text) & ")" -- add the specific error number
set the end of SkippedItems to (AnItem as text) & ErrorNumber
end try
end repeat
ShowSkippedAlert for SkippedItems
return the output -- pass the result(s) to the next action
end run
to ShowSkippedAlert for SkippedItems
show an alert dialog for any items skipped, with the option to cancel the workflow
parameters - SkippedItems [list]: the items skipped
returns nothing
if SkippedItems is not {} then
set {AlertText, TheCount} to {"Error with AppleScript action", count SkippedItems}
if TheCount is greater than 1 then
set theMessage to (TheCount as text) & space & " items were skipped:"
else
set theMessage to "1 " & " item was skipped:"
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
if button returned of (display alert AlertText message (theMessage & return & SkippedItems) ¬
alternate button "Cancel" default button "OK") is "Cancel" then error number -128
end if
return
end ShowSkippedAlert
</pre>
5) *Copy Finder Items* { To: _your external drive_ } -
File extraction -File name is timestamped
Hi Team,
We are loading the data using flat file. The file will be stored in the application directory. we created a logical fiel name and it is used in the data source.
My problem is every day the file is uploaded to the applicaiton directory and the file name will be appended with time stamp
for example
file_01022011123445
file_02022011042015
I tried to handle this by creating an abap routine ,but i am unable to get the exact file name since the timestamp field is dyanamic.I even tried to read the file names from the applicaiton directory using following function modules
SUBST_GET_FILE_LIST
F4_DXFILENAME
FILE_GET_NAME
But it didnot worked. Any suggestion will be appreciated.
Thanks,
Jim
Edited by: Jim Jose on Feb 2, 2011 1:04 PMHi,
Your file naming convention seems to be "file_ddmmyyyyhhmmss". That means you already know the first 13 characters of the filename you need. ("file_" is constant, the next 8 characters come from sy-datum)
The FM SUBST_GET_FILE_LIST accepts wildcards, so you could give the FILENM parameter as *. It would give you the names of all the files in the directory. After that, it is a matter of ignoring all the files which do NOT begin with those 13 characters. If you have one file being created in the directory for every day, this should work
Regards,
Suhas -
Mapping Dynamic File Names - JDev 10.1.3.1.0
It is important for me to be able to capture the name of the inbound file while mapping in the XSL builder. I need it to be mapped to an XML value on the target side. The file name will be dynamic so it will not be possible to hard code it. Is anyone aware of a tool that can do this for me? I would only like the absolute name of the file, not the entire path.
Thanks, EricPerhaps better late than never...
This is a limitation in JDeveloper that it cannot render an XSL in design/mapper view when it contains these features of XSL. Pretty much 100% of AIA transformations fall into this category.
Maybe you are looking for
-
Hello all, I want create a BSP page, with 2 radio buttons, If 1st selected I want read 2 tables and display data other BSP page. If 2nd one selected I want download 2 tables data into excel file. Any one can help how to download data into excel file
-
I just bought a fire wire 366mhz clamshell off eBay. Can I hook this laptop up to a video projector? Does it have a video out? I have seen cables for sale on eBay that states they are for some g3 units, is mine equipped for it? Ibook clamshell - 366m
-
How to call Java script from java code?Can Jscript be executed at server?
Hi All, We are using 'WebTrends' tool to analyze our site usage pattern. To use WebTrends, we need to : 1) call Java Script code from the java code 2)Java script has to be executed at server. Please comment on two points mentioned above. If yes, plea
-
How to hide discoverer connection page after opening discoverer plus?
Hi, I invoke the following url in browser window 1 to open Oracle DIscoverer Plus. I notice the browser window 1 will open a window (say i call it browser window 2) to display the Oracle Discoverer Plus application. Once the Oracle Discoverer Plus ja
-
Pls, I'm getting the following error messages when I run my class java:3:cannot find symbol symbol: class Student location: package coreservlets import coreservlets.Student; Now look how I created my class and package. (1)The root to my package is C: