How to Append date time to the Source File Name in send Port without Orchestration

Hi,
I am using the Macro %SourceFileName%_%datetime%.zip in the filename(Send Port).
say my file name is ABC.zip
But I am getting the output as ABC.zip_2013T083444
Please suggest, How to avoid the extension?
Vignesh S ----------------------------------------------------------- Please use Mark as Answer if my post has solved your problem and use Vote As Helpful if my post was useful.

The problem here is %SourceFileName% context property would return filename “With” extension. So when you use %SourceFileName%_%datetime%.zip you get FileNameWithExtension_Datetime
For this you have to handle it either in customer pipeline component or in orceshtration where you have to remove the extension from the Filename.
Read this post on remove the extension from this file name
msgOut(FILE.ReceivedFileName) = System.IO.Path.GetFileNameWithoutExtension(msgIn(FILE.ReceivedFileName));
After this if you use the
%SourceFileName%_%datetime%.zip macro, you would get the desired output.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

Similar Messages

  • How to add a date suffix to the log file name

    In Windows, I want to run certain commands and save the output to a logfile every day. How to add a suffix to the log file name so I can distinguish which log file for which day?
    e.g. cmd >> logfile.date

    AZ wrote:
    In Windows, I want to run certain commands and save the output to a logfile every day. How to add a suffix to the log file name so I can distinguish which log file for which day?
    e.g. cmd >> logfile.datemy best friend name is "google", refer to this [url | http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-usi]
    This is what i did
    1) created a dummy file in c drive
    2) copy pasted below lines, you can play around more with the format
    set _my_datetime=%date%_%time%
    set _my_datetime=%_my_datetime: =_%
    set _my_datetime=%_my_datetime::=%
    set _my_datetime=%_my_datetime:/=_%
    set _my_datetime=%_my_datetime:.=_%3) Rename the file from dos
    ren some.txt dummy_file_%_my_datetime%.txt4) Here goes the output
    C:\dir
    dummy_file_Mon_09_20_2010_161347_21.txt
    Most of the code i copied from above url, you can tweak a little bit based on ur requirement and format.
    Regards
    Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How do I map the source file name to a target table?

    I am mapping a source fixed length flat file to oracle target tables. One of the tables is a parent transaction table that stores the date, record number, status, etc. and the file name of the source flat file. The file name will change daily because the date is part of the naming convention. Is there an easy way to determine the source file name and map it?
    One option a co-worker is working on is writing a pre-mapping stored procedure. It would insert the file name into a table prior to the mapping. But I was hoping for a cleaner solution.
    Thanks!

    Hi
    Use extarnel table to load the data from the file into the table.
    Create a procedure which changes the external table definition as the filename chnages.
    Use this proceudre in the mapping as a premapping process.
    Ott Karesz
    http://www.trendo-kft.hu

  • Dynamic File Name depending on the Source File name

    Hi Experts,
    I have a problem like Dynamic File name depending on the Source File Name. I will explain with example as follwos
    Source File name                 Targer Folder/Filename
    NK01.VR59.L2007030         VR59/Rec.l200
    NK01.VR71.L2017030         VR71/Rec.l201
    NK01.VR77.L2027030         VR77/Rec.l202
    See above the exaple, Depending on the Source file name, I am deciding where i need to place my file and what name i need to name it.
    So please suggest me the solution and How can i do this with a single communication channel ? Do i need to create multiple CC for each folder??
    Points will be rewarded for Valuable anwer.
    Thanks in Advance,
    Best Regads,
    Vijay

    Hi VIjay,
    Thanks for quick reply. But i am getting error in End to End Scenarios only. If i remove the Return " "  statement from the UDF, while activating it is showing the error saying like missing return statement. I also mapped to the top most node to this UDF.
    I am getting the following error in End to End error Scenarios:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_Target_File_determined_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Target_File_determined_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

  • Accessing comapny code from the source file name

    Hi,
    Iam doing FILE –FILE to scenario.
    My source file name is XXXX237061606.txt. (XXXX is company code)
    My requirement is …
    Based on company code from the source file name; I need to send the file to the corresponding receiver.
    How to retrieve the company code from the source file name?
    Thanks,
    Hem.

    hem chand wrote:>
    > Hi Varun,
    >
    > Could u please provide me detailed procedure to get the company code.
    >
    > Reg,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    This will get you the File name...TRuncate it to extract company code...
    Then have a mapping program with the receivers message type which is persent under SAP BASIS component....
    There map to the required receiver by getting the file name above..
    Create an int mapping for the above mapping and use that in ur enhanced recv determination

  • Getting the Source File name Info into Target Message

    Hi all,
    I want to get the Source file name Info into Target message of one of the fields.
    i followed Michal BLOG /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Requirement :
    1) I am able to get the Target file name as same as the source file name when i check the ASMA in Sender & Receiver Adapter , with out any UDF...............this thing is OK
    2) I took One field extra in the target structure Like "FileName" & I mapped it Like
                              Constant(" " )--UDF-----FileName
    I Checked the Option ASMA in Both Sender & Receiver Adapters
    Here iam getting the Target File name as same as Source file name + Source File name Info in the Target Field " FileName".
    I Dont want to get the Target File name as same as Source file name. I want like Out.xml as Target file name.
    If i de-select the Option ASMA in Adapters means it is showing " null" value in the target field "FileName".
    Please Provide the Solution for this
    Regards
    Bopanna

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • UDF to capture the source file name or the source folder for mapping

    Hi All,
    i have 2 files -  File1 from File2 from 2 different folders- single comm channel FTP (FCC). i have to pass a constant A and B respectively to a field in target structure.
    my options are -
    either create a new field in source str populating different constants and  then map to the target str
    or a udf to get the source file name or the source folder so that i can map the constant using the value mapping/FixValue mapping.
    please suggest. thanks.
    rajib

    Hi,
    please use the UDF to determine the file name. Then based on file name either pass A or B to your target field.
    The code is as given below. Just tweak the code to pass either A or B as per your requirement.
    public String G_GetFileName(Container container) throws StreamTransformationException{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    Regards,
    Deepak.

  • How to write Date/Time property of tdms file

    On the root page of the tdms file, there is a built-in property called "Date/Time" in the first row.
    I would like to use it to save the time stamp when the tdms file is created. But in the help file,
    I only find the following property constant. So, how can I write to the "Date/Time" property field?
    Property
    Constant
    Data Type
    Name
    TDMS_FILE_NAME
    String (char *)
    Description
    TDMS_FILE_DESCRIPTION
    String (char *)
    Title
    TDMS_FILE_TITLE
    String (char *)
    Author
    TDMS_FILE_AUTHOR
    String (char *)
    Thanks for any idea or suggestion.
    Solved!
    Go to Solution.

    Not sure if this is exactly what you want, but have you tried this?
    CVIAbsoluteTime CVItime, *t = NULL;
    TDMSFileHandle deH = 0;
    // Create TDMS file and set some properties
    errChk (TDMS_CreateFileEx (file, TDMS_Streaming2_0, TDMS_ByteOrderNative, 0,"example.tdm", "someText", "title", "author", &deH));
    GetCurrentCVIAbsoluteTime (&CVItime);
    errChk (TDMS_SetFileProperty (deH, "Date/Time", TDMS_Timestamp, CVItime));
    // Save and close file
    errChk (TDMS_SaveFile (deH));
    TDMS_CloseFile (deH);
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to setup do not move the source files ?

    Media encoder change the source file position.some software can not find the change. do not  do angthing to my source files@

    You can simply download the PDF files from the workspace to your desktop.

  • How to use dates/times in the definition of local fields?

    Hello!
    I have few tough questions for which I haven't found an answer. I hope someone is capable to help me.
    1. Is there a transaction to search tables if we know the field?
    2. I'd like to define a local field and need to use dates in the calculation function. So basically I need to calculate the lean-time from the date of the purchase order (field BSTDK) to the date of the final delivery (field PLIFTS) and the result should be displayed in weeks. How can I do this? Or can I?
    3. Can I use the local fields further in my calculations?
    Thank you in advance!
    Maria Kangasniemi

    Hi,
    1. Is there a transaction to search tables if we know the field?
    Tcode:    SE84
    2. I'd like to define a local field and need to use dates in the calculation function. So basically I need to calculate the lean-time from the date of the purchase order (field BSTDK) to the date of the final delivery (field PLIFTS) and the result should be displayed in weeks. How can I do this? Or can I?
    Doing some calculation you can define it.
    3. Can I use the local fields further in my calculations?
    What is local Fields?

  • How to get the source file name and transform into database

    Hi,
    We need to load data from source file abc.csv into oracle table. during loading, we need to keep the file name abc.csv and write into the database table as one field. Is there anyone who did the similar task? and how to make it? Pls help!

    Hi,
    If you can write the filename to a text file, you may do the following:
    (1) create a text-file containing the name of your source-file.
    (2) create an external table using that text-file as input.
    Now, you can SELECT the filename from the external table.
    Of course, you need a way to : create the flat file, handle the flat file, etc.
    Grtz.

  • Install RMS 13.1 How to add data boundaries  in the ddl  files for UK?

    Hello Retail Gurus,
    I have installed RMS 13.1 without running the partition.ksh script while installing the Retail Database for RMS and it created some sample data too, I have seen the Install Guide and especially looked at the Partitioning Steps in the Guide , Can anyone give a hint ,how the data boundaries are modified in the ddl files for UK?. Since I am a DBA i am little confused , from where to get these data? as the installation guide mentions that the RMS_partition_defintion.xls has to modified and used for a production installation combined with partition_attributes.cfg for a production installation.
    Thanks in Advance
    -- Vivek

    Hi Vivek,
    Let's see...
    UK means united kingdom of great brittain? I think there are no UK specific DDL statements related to RMS.
    If you look at the installer (unpack the zips from edelivery.oracle.com for e.g. RMS 13.1), checkout the folders
    V16908-01\rms_13.1_install\rms13dbschema\rms\dbschema\dbscripts_rms\examples\part
    V16908-01\rms_13.1_install\rms13dbschema\rms\dbschema\dbscripts_rms\ddl\part
    This contains a ksh script that is driven by a config scripts and some lists of specific partitions in folder data_def.
    This partition.ksh script can recreate some table's DDL from non-partitioned to partitioned.
    The mentioned XLS file can also be found in this folder and helps in setting the number of partitions and doing one dimensional or e.g. multi-dimensional (e.g. range/hash).
    The whole process is explained in quite some detail in the last chapter of the merchandise implementation guide, merch-131-impg.pdf.
    When your system already containts data, this should be saved and re-placed.
    Please note that the indexes on partitioned tables may need partitioning too, at least some reflection on this is required and afaik the RMS installer tries to cater for this too.
    Best regards,
    Erik Ykema
    Edited by: ErikYkema on Oct 29, 2010 8:05 AM

  • AUR policy on packages with no version in the source file name

    I know that the AUR policy says that no code must be included with the PKGBUILD if you are not a trusted user. But, how do you deal with packages that do not have their version number in the file name: http://www.somesite.com/someproject.tar.gz instead of http://www.somesite.com/someproject-1.0.tar.gz. The problem is that when ''someproject.tar.gz" gets updated, and it will, your AUR package is broken. The MD5 sums won't match and patches may not apply either. You can get around the MD5 problem by not including a MD5 sum, and the package might install correctly if the patches still apply. However, the package version in the PKGBUILD will not match the version of what it installed on disk.

    I have some TeX related packages and it is some kind of politics to not have a pkgver in the filename there. But there are announcements on the certain mailing lists or users complain.
    So if the version number is stated in one of the distributed files, I take that. Most of the cases can be solved that way. The remaining cases drag0nl0rd's suggestion is doable.

  • PDF: How to get date/time into the heading of a FOP/PDF file?

    Hi!
    What changes do I need to make to the PDF report template or what else can I put in the heading block of the "Print" page so that it will include the date and time the PDF was generated?
    Also how would I add this so that it prints on the bottom of the page like the page number?
    Thanks in advance for any tips, tricks, ideas, examples, etc.!
    Dave Venus

    Hi!
    Perhaps I missed this some place but you can get the value of a page item or application item into the header or footer of a (FOP) PDF report by using a "&<item>." format substitution string. For example I have a 1 time application process that puts todays date in an application item named F106_SYSDATE (F106_ is the application id). Then in my headers I use:
    XXXX Report on: &F106_SYSDATE.
    Simple. Works great! And better yet my users are a little happier! :)
    Thank for everyone's help and suggestions!
    Dave Venus

  • How to Append Date to Export Dump file name

    hi everyone,
    This is 10g on Windows.
    I want my dump file name to reflect the date it was ran on. I'm using the Job Scheduler tool in Database Control.
    So when I try EXPSSU%date.DMP as the dump file name, I get error "dump file name "EXPSSU%d.DMP" contains an invalid substitution variable ."
    what is the correct syntax? I dont care about the formatting of the date - whatever the default is will be OK.
    Thanks, John

    i have the same problem, any one have the solution?!?!??!

Maybe you are looking for

  • Error after deployment

    Deployed hyperion on Oracle Application server sucess fully. How ever unable to go open hyperion console. if i see in opmn.log i got these entries. ======= 09/11/10 10:43:08 libopmnoc4j Process Ping Failed: ProviderServices_Group~OC4J_ProviderService

  • Adobe Reader Fullscreen Preferences Second Monitor Only

    Hey, I'm trying to set adobe reader to open in fullscreen mode on my second monitor instead of whatever monitor it's currently displayed on. I've looked through preferences, but the options for which monitor to use are descriptors like this monitor,

  • Re: impdp - duplicate keys found error

    Today I faced same problem. impdp, expdp log are showing same number of records but target database has more number of rows(duplicate) in few tables. Source database version 10.2.0.4 and target database version is 11.2.0.3. I loaded the same dump fil

  • Flash Player issues with Windows 8 / IE 10

    I cant get this to work and I've tried every link. Even going to the download flashplayer site, it comes up blank. It says it's already installed but i have several sites that I cannot get onto and asks me to update flash player. I've enabled the Add

  • Internal Order Change

    Dear Gurus, We have an Internal Order and we want to change the Responsible Cost Center and the Profit Center fileds in the Basic Data. But we can only change the Responsible Cost Center field only... how  can I change Profit Center field too... Than