Variable subsitution for target file names
Hi All,
I am using variable subsitution for dynamic file names. I am using the multimapping for multiple files in the target.So i coluld not able to use the dynamic configuration for file names. Now i want to replace all the spaces in the filename to underscore.
For example
My payload filed value "file name in the target file".
Now my filename "file_name_in_the_target_file".
How to achieve this using Variable subsitution.
Regards,
Ramalakshmi.G
Use replaceString Function.
file name
Constant (" ") --> replaceString -------> TargetField
Constant ("_")
Regards
Ramesh
Similar Messages
-
Using System::StartTime in variable for external file name comes out incorrect sometimes
Hi All,
I have an interesting dilemma. I'm using SQL Server 2005 with Visual Studios 2005 (9.00.4035.00).
I'm writing records from my database table out to an external flat file, nothing fancy other than in the naming of the file being dynamic and using system time. So I have a couple of variables set:
CR_Dir = \\host\directory\
CR_Outfile = "AP_" + (DT_WSTR, 4) YEAR( @[System::StartTime] ) + RIGHT("0" + (DT_WSTR, 2) MONTH(@[System::StartTime] ),2) + RIGHT("0" + (DT_WSTR,2) DAY( @[System::StartTime] ),2) + RIGHT("0"
+ (DT_WSTR,2) DATEPART("Hh", @[System::StartTime] ), 2) + RIGHT("0" + (DT_WSTR,2) DATEPART("mi", @[System::StartTime] ),2) + RIGHT("0" + (DT_WSTR,2) DATEPART("ss", @[System::StartTime] ),2)
+ "_chref"
And then in my Connection Manager properties I have an expression that brings them all together with a file extension:
@[User::CR_Dir] + @[User::CR_Outfile] + ".ctl"
So what I should get for example is something like AP_20140309214502_chref.ctl (if the job was run on 03/09/2014 @ 9:45pm) When executed properly. I do this for two flat files one with an extension of .txt and the other with .ctl.
These steps are working fine the majority of the time.
However, my problem is that occasionally, the portion of the filename that contains the datetime stamp is completely incorrect for one of the two files that are created during the same time frame. And I'm not talking about a few seconds or even a minute
or two, the date is off by weeks. Here's an example:
AP_20140309214502_chref.txt
AP_20140213152253_chref.ctl
This has happened twice since starting to run this job over the past four months, once on 12/15/2013 and again 03/09/2014. This job is run every night at 9:45pm, and all the other days that this job runs the two filenames come out perfectly.
So I'm leaning towards something in the system that may be corrupting my variable every once in a while? But because it happens intermittently how can I verify this? Or is there a better way to perform what I'm trying to do that would be more accurate
and consistent?
Any help would be appreciated.
Thanks
SawyerHi All,
I haven't found a solution to this issue. I'm not actually able to reproduce it at will, so it's hard to troubleshoot. What I've decided to do is rewrite my variable expression and make one system call for date and time and place it into
a variable and then use the variable to build the file name. Also I changed from using the System::Startime to using the GFETDATE() function (Don't know if this helps but it was easier to use in my substring when I parsed out the different time elements:
v_DATETIME STRING SUBSTRING((DT_STR,30, 1252)GETDATE(), 1, 19)
CR_Outfile STRING "AP_" + SUBSTRING(@[User::v_DateTime],1 ,4 ) + SUBSTRING(@[User::v_DateTime],6 ,2) + SUBSTRING(@[User::v_DateTime],9 ,2) + SUBSTRING(@[User::v_DateTime],12, 2) + (@[User::v_DateTime],15 ,2) + SUBSTRING(@[User::v_DateTime],18,2)
+ "_chref"
I don't want to leave this thread as unanswered for too long so I'll give it another day or two and then close it. I'll report back in a few months to let you all know if this problem has reoccurred or not.
Thanks for the assistance.
Sawyer -
Need Target File Name Timestamp is same as Source File name Timestamp
Hi ,
I want to genereate Target file name (Target_09062008082030.xml) but this time stamp is exactly Sorce FileTime stamp..(Source_09062008082030.xml)..
so, i want to create a target file with the same source file time stamp..
for this.. i sed Message Specific attributes... in both sender and receiver side.. but that was creating with the complete name.of source file name.. but i want only Timestamp of the source filename... and remaing is the constant.. for this how can i proceed ..
Thanks
JainSee in Sender CC when you set the Adapter Specific Message Attr for file name it will send the filename in the header of the XI Message.
To acces this file name inside mapping you need to create a UDF . The type can be any thing as you desire.
You dont need to pass any variable .if suppose you want the file name (constant) e.g ABC_<timestamp>.xml
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fileName= conf.get(key);
//see above your key is FileName which will be sent by the sender CC automatically... You are simply accessing it here using get() method.
//now ur filename will contain name of the source file... you need to perform a substring operation to get the timestamp and create a new file name as you desire.
fileName = "New_<timestmp>.xml"; //for e.g
//set this file name again in header message using put()
conf.put(key, fileName);
//when you check on the adapter specific message attr for fileName in the receiver CC ,it will automatically take this new file name value.
return fileName;
// if you want to use this new fileName inside your mapping payload (for other fields) you can assign this to any target field,else just assign it to the root tag which will make no difference if this file name is not used anywhere. -
Target file name as field in target structure
Hi SDNers,
I have a requirement where I need to populate a field in target structure with the target file name, this will be a counter.
So if the interface is run 2 times already the third file should have name XXXXXXX_03 and also this needs to be mapped to a field in the target structure.
Any ideas on how to achieve this?
(Pls Note: I am aware of ASMA and variable substitution)
Regards,
Gautam PurohitHello Gautam!
File adapter - How to pass File name and path at runtime
This SDN topic probably covers the requirement you mentioned!
BR,
Lucas -
Invalid Path for target file, check if connector is deployed correctly
Hi all,
I've got a tricky problem over here: we are using OMB scripts for generating simple extract mappings that just copy data from an oracle source table to a flat file on a directory. Up untill now ( with version 11.1 ) this did not pose any troubles, but now we are using 11.2 for the first time and we don't get the mappings to execute. Generating, validating and deploying all works fine, only executing fails with the error: "Invalid Path for target file, check if connector is deployed correctly". It ends to rapidly, so I'm assuming the problem lies in the repository and not on the database itself.
I'm pretty sure all locations are defined as needed, flat file operator in the mapping has correct location, the flat file module has the same location,...
I tried almost everything: recreate oracle module, recreate flat file module, unregister and recreate db location, unregister and recreate dir location, recreate mapping and flat file, export/import...
The strange thing is, I was able to execute a mapping once. Although it ended with an error (due to a function in the mapping), it created the file correctly. After that I needed to update the directory path of the target location and from then on, I always got the error above, and I don't see a good reason.
Any suggestions??
Tnx,
MichelThat error is displayed when the generated code fails to execute with one of the following database errors;
UTL_FILE.INVALID_PATH
UTL_FILE.INVALID_OPERATION
UTL_FILE.INVALID_FILEHANDLE
So its worth checking the generated code for that map and searching for the code around UTL_FILE.FOPEN and seeing what the path and the file name in the code are. Maybe the file is created with permissions such that it can be created but not then re-written and its an OS permissions thing (such as UMASK settings).
Cheers
David -
INVALID PATH FOR TARGET FILE - 11g
I had several mappings that's need to run almost all of my mappings got this same error,
OWB Owner: owb_rpo_ev04
User Owner: owb_rpu_ev04
h2. "INVALID PATH FOR TARGET FILE, CHECK IF CONNECTOR IS DEPLOYED CORRECTLY"
-Flat File Location has been indicated
-Locations has been deployed
-Files Location has been deployed
-Physical Location has been created
Two mappings is working prefectly without any error, but to several mappings the one with Flat Files Location are the one with the error when executing. I already grant permission owb_rpu_ev04 to UTL_FILE. I even create a synonym for UTL_FILE the i can used "ECT_FILE"
Files are in FTP,
h2. partial script
OUTPUT_FILE ECT_FILE.file_type;
FILENAME VARCHAR2(50);
FILEPATH VARCHAR2(50);
email_subject VARCHAR2(200);
email_body_hdr VARCHAR2(10000);
crlf VARCHAR2(2) := chr(13)||chr(10);
OWB_FAILURE_RUN EXCEPTION;
PRAGMA EXCEPTION_INIT (OWB_FAILURE_RUN,-20000);
PROCEDURE CHK_EXECUTION (EXEC_FLAG IN NUMBER) AS
BEGIN
IF EXEC_FLAG = 3 OR EXEC_FLAG = 4 THEN
RAISE OWB_FAILURE_RUN;
END IF;
END;
BEGIN
FILEPATH := 'ECTDM_EV04_OUTFILE_DIR';
-- ECTBusiness.csv
ECT_RUN_BATCH_MAP1 ( 'PLSQL', 'ECTDM_IN_M_BUSINESS_L1', 'OWB_RPU_EV04_LOCATION', 'ERROR_DETAILS', 0, EXEC_FLAG, 'A','DM');
CHK_EXECUTION (EXEC_FLAG);
Edited by: ellenore on Apr 26, 2012 5:52 AM
Edited by: ellenore on Apr 26, 2012 6:03 AMThat error is displayed when the generated code fails to execute with one of the following database errors;
UTL_FILE.INVALID_PATH
UTL_FILE.INVALID_OPERATION
UTL_FILE.INVALID_FILEHANDLE
So its worth checking the generated code for that map and searching for the code around UTL_FILE.FOPEN and seeing what the path and the file name in the code are. Maybe the file is created with permissions such that it can be created but not then re-written and its an OS permissions thing (such as UMASK settings).
Cheers
David -
Framemaker uses <$filename> for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen? In compiling our books it would be helpful to not have this extension appear as it then requires us to create extra files without them.
See: System Variables
-
Need to genereate Target file name same as Source File Name thru Local J2SE
Hi Everyone,
I want to genereate Target file name exactly same as Source File Name. I know how to handle this in Central Adapter Engine(Sender & Receiver Communication Channel).
But I need to do this in Local J2SE adpater engine.
Please help me in this regard.
Thanks & Regards,
NagarajuU can use the parameter to save the filename in the message header
file.messageAttributes=<name,directory>
This is similar "Adapter-Specific Message Attributes" concept.
http://help.sap.com/saphelp_nw04/helpdata/en/6f/246b3de666930fe10000000a114084/frameset.htm
Regards,
Prateek -
I am trying to update ipod touch from ios 4.3.2 to ios 6.1.3. I have it connected to my computer, and the summary in itunes indicates the update is available. However, when I click "update", it opens Windows Explorer and waits for a file name to open.
I am not at that computer now, but I did check via windows update & with the check updates menu choice in the itunes program - neither indicated a newer version of itunes is available. (it is a vista computer).
The itunes software on the computer displays my ipod & the current ios (4.3.2), and indicates a newer ios is available (6.1.3). When I choose "update", I am taken to Windows Exploer and prompted to choose a file to open. it is as if the "update" button has the incorrect code attached to it.
The ipod is working, but there are several app I would like to install, but I can't with the current ooperating system. -
I'm trying to get to "www.enoriver.org." A window appears asking me to choose an application--I choose Firefox. Then another window opens titled "Another Application" and asks for a file name at the botto0m of page. I choose Firefox from the list of files, paste it into the bar, hit "enter"--nothing happens. What do I do?
Hi Leo! If you can stop these down load managers, you will be my hero.
Dokie!!
PS I have tried my best to warn members here on the forum, but I haven't got a lot of support so far.
I have my figers crossed that the new team will get-er-done -
Sender file adapter - Can I use *.xml for the file name
Hi Gurus,
I have some interfaces where I need to pick the file from a directory. The name of the file will have Data<i>time stamp</i> as the naming convention. Can I use *.xml to pick up my files from this directory?
The help.sap.com documentation says that we can use this naming convention.
<b>
● File Name
Specify the name of the file that you want to process. The name can contain placeholders (*, ? (placeholders for exactly one character)) so that you can select a list of files for processing.
</b>
I tried using *.xml for my file name in the communication channel, XI is not picking up this file.
Please let me know if you have the solution.
Thanks
KalyanMurthy,
Thanks for the reply.
I am using GuildFTP tool as my FTP server. In this tool, all the permissions were given for the file to pick up.
The status of the file is good.
Where in the file adapter configuration I have to select 'Read-only'?
The file adapter is working perfect with the exact name of the file.
Thanks
Kalyan -
when I open up an e-mail attachment a box pops up PRINT TO FILE below that line OUTPUT FILE NAME with an empty line for the file name vs. simply going to my default printer?
Make sure that '''''Print to File''''' isn't selected in the native print dialog box ''(see screenshot below)'' middle-right, and make sure your Printer is selected at the top of that dialog box.
''I'm a little confused why an email attachment would need to go directly to the printer, but that's what you asked about.'' -
How can i search for multiple file names (images) in bridge?
Hello everyone!
Does anyone know how to search for multiple file names in bridge?
That is to copy & paste something like this: _MG_2152, _MG_2177, _MG_2194, _MG_2195, _MG_2202, _MG_2212, _MG_2219, _MG_2261, _MG_2362, _MG_2401
Not using several criterias in the search box that is. That takes too long.
Thanks
Steffen Rikenberg Photographer
Oslo, Norway.
www.steffenrikenberg.noTry this add-on [https://addons.mozilla.org/it/firefox/addon/find-all/ Find All]
-
How to programmatically disable prompts for output file names in Acrobat X
My code to programmatically disable output file names (below) is not working on a Windows 7 64-bit machine using Acrobat Distiller X. It works perfectly on a Windows XP machine with Acrobat Distiller 8.
The latest API Reference I was able to find is dated June 2008. My logic follows this convention.
I have confirmed that the registry key is updated as specified below. I have also confirmed that I am able to write to the directory indicated.
Please provide any suggestions to resolve.
Thank You!
~Lori
'Create the Registry Key where Acrobat looks for a file name
CreateNewRegistryKey HKEY_CURRENT_USER, _
"Software\Adobe\Acrobat Distiller\PrinterJobControl"
'Put the output filename (FilePath) where Acrobat could find it
SetRegistryValue HKEY_CURRENT_USER, _
"Software\Adobe\Acrobat Distiller\PrinterJobControl", _
C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE, _
T:\PDF Files\Current Week\NFS_Lori,Test.pdfI remember seeing that the problem is thunking. A little more specifically, because it's a 32-bit driver but a 64-bit executable, there's a 32-bit system spooler process which will always show up as the EXE name.
-
How to get target file name and buffer the incoming messages?
Hi Experts
I have one scenarion like
I wanted to find whether is there any file existing in target folder. If it exists I dont want to overwrite it but I have to buffer the incoming messages in some queue or something like that. And when ever the request comes next time I have to send the data buffered in queue first.
I dont want to add any time stamp for target file to avoide duplication.
Can we do this using XI. If yes please suggest me how to achive this.
Regards
Sowmya>
Sowmya wrote:
> Hi Experts
>
> I have one scenarion like
> I wanted to find whether is there any file existing in target folder. If it exists I dont want to overwrite it but I have to buffer the incoming messages in some queue or something like that. And when ever the request comes next time I have to send the data buffered in queue first.
>
> I dont want to add any time stamp for target file to avoide duplication.
>
> Can we do this using XI. If yes please suggest me how to achive this.
>
>
> Regards
> Sowmya
there is no standard way to achieve this. I suggest a redesign.
post the files to a different directory and write a script which will move the file to the required target directory only if it is not present there.
Maybe you are looking for
-
Media Encoder CC - Bug or just finicky?
I'm confused about Media Encoder, and hoping someone can help. I have a short film that's primarily 4K ProRes augmented with some "flashbacks" that are 1920 by 1080 h264 files. All edits beautifully in my 4K ProRes timeline. I have some Magic Bullet
-
Why is the lock screen message not centered?
In the Security & Privacy settings, we now have a graphical method for setting a login message instead of having to use terminal. I have noticed an issue though. On the login screen, the message displays as it should, centered on the screen at the bo
-
Error after changes in workflow file (.wft)
Hello Friends, I have got one customization request in workflow notifications and that required changes in standard packages. I have made custom copies of those with required changes and then opened workflow file in wordpad and replaced the standard
-
Respected sir i am vengo and i need help and how to get Ps in my system i need 499/INR scheme per month, regarding this i send the mail to the adobe they told me that somebody call you from india and after that you may get the 499 scheme but still n
-
I have a project created in VS 2008 that has one report in it. When I open it in VS 2010 with CR 2010 installed it asks if I want to convert the report. I tell it no since i don't want to move to the 4 framework yet. Everything worked great. Then