Check file size in ODI

dear all,
how to check file size in oracle data integrator.
regards
Naseer

Hi Naseer,
Here you go.
Step 1:
In your existing LKM add a step, "Check File Count" (Make this as first step).
Command on source
Technology : File
Command On Target
Technology : Jython
Command:
import os
# open the file
fsrc = open('<%=odiRef.getSrcTablesList("", "[SCHEMA]/[RES_NAME]", ", ", "")%>', 'r')
# read the first line
lsrc=fsrc.readline()
# set row counter, starting on the second line
n = -1
# count lines
while (lsrc):
-------lsrc=fsrc.readline()
-------n = n + 1
# Check for the record count
if n<1:
-------os.system('C:\OdiSendMail.bat')
-------raise '\n Can not process further as the file doesnt contain rows'
Step 2:
Create a batch file OdiSendMail.bat at C: and paste the below code after modifying as per your environment,
cd C:\OdiHome\oracledi\bin
startcmd.bat OdiSendMail "-MAILHOST=mail.server.com" "-FROM=[email protected]" "-SUBJECT=Hi" "-TO=[email protected]" "-MSGBODY=The file doesnot contains rows to process, please resend a new file."
Prerequisites:
1. Odiparams.bat should be updated with your corresponding "Repository Connection Information" .
2. Replace "---" with tab in Step 1.
3. Change Step 2 first line to point to your corresponding <ODI_HOME>\oracledi\bin location as such.
Hope this gives solution as you are looking for, try this and let me know. Let me know if you have any difficulties in any steps.
P.S: This above code is tested in my local and working as expected. I am still working on calling OdiSendMail within jython, if i got any updates will let u know.
Thanks,
Guru

Similar Messages

  • How to check File size of a Text file.

    How to check File size of a Text file.
    please explain me.
    I am new in LabVIEW. and dont have much idea on this...;
    Prashant Soni
    LabVIEW Engineer
    Solved!
    Go to Solution.

    Hi Prashant,
    and here's what you get when using the LV help...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • What is the file size that ODI can handle

    Hi all,
    What is the file size that ODI can handle ?????????
    can it handle 1GB files without any issues?????????
    Thanks
    Phani

    Hi Phani,
    It also depends on the type of file you are transfering. If have used the XML file around 1GB and the performance is very low. But we used the Database schema to load the XML data and the performance had increased very well.
    I never tried the large flat files load around 1GB.
    Thanks,
    Yellanki

  • Check the size of uploaded file in Oracle UCM

    I need to check the size of the uploaded primary file in Oracle UCM during checkin. I tried writing a filter on the event validateStandard and check the value of dFileSize. But the value is null. Any ideas what event should I use and which parameter should I check?

    hi,
    I am new to Oracle UCM. I need same functionailty of checking file size of uploaded content. Could you please elaborate how you achieved it..... thanx in advance.

  • HRRCF00_DOC_UPLOAD - attachment file size check

    Hi all,
    I am trying to implement two checks that are supplied by BADI HRRCF00_DOC_UPLOAD.  I need to validate file type and file size of documents that are to be uploaded to ERC.
    I was able to implement file type validation in method CHECK_ATTACH_FILE_TYPE (SAP calls them mimetypes) by using function SKWF_MIMETYPE_OF_FILE_GET and by passing the filename from the input parameters of the BADi.  This approach was specified in the BADi help.
    I would like to do something similar in method CHECK_ATTACH_FILE_SIZE, but I do not see how I can check file size.  File size is not one of the parameters provided by the BADi and I searched the system for functions that might provide file size for a mime-type object and did not find any.  There are other functions that give file size, but they seem to be focussed on documents that are already stored in SAP.
    If someone else has implemented this check, your advice is appreciated.  Thank you.

    Hi Mike!
    I did not find your BADI in the system I currently have access (maybe a release or installed package problem) - but still I like to give you a hint.
    There is a class CL_GUI_FRONTEND_SERVICES with the method FILE_GET_SIZE. At least for a path/filename to a local file you can get the attributes of the file with this function.
    Regards,
    Christian

  • Problem with CS2 edit file size

    When I create a new version of a 3-4mb original, make a few simple modifications in CS2 and save back to Aperture the resulting version is almost 70mb. If I export this version from Ap back to my desktop and check file size it is back to near the original size. Yet, when I check the file size stored in my Ap library, it is 70mb. This will fill my hard drive in a hurry! Can someone help explain this ??

    I did a little more experimenting by making external edits in PS on a 3.9mb JPG file in both Aperture and Lightroom to see what the resulting file sizes were. In both cases I left the master outside the library so that I could see file additions in both the application library and in the folder containing the originals and revisions. I looked into the file directories to determine real file sizes rather than relying on info from the applications. The increase in library file size was small in both apps. However, there was a significant difference in the revised file size between Aperture & Lightroom in the folders containing the originals. The best I could do in Aperture produced a 24.6mb psd revised file, which showed as a version in the App., in addition to the master. Lightroom gives the option to revise the master or revise a copy of the master when exporting. When revising a copy of the master, the result was a new jpg file approximately the same size as the master - 3.9mb - which appeared as a version. This is what I would like to be able to do in Aperture.
    I have been using PS for several years for all my photo enhancements and have developed a pretty comfortable and effective routine. Having used Aperture for a couple of months now, I can see that most minor edits can be done more easily in Aperture, but the same is true of Lightwell. Although I would probably only use PS on less than 25% of my keeper photos, this increased storage requirement seems more trouble than the advantages of Aperture vs Lightroom are worth. Maybe Apple will make a change in the next revision that will effect this situation and make Aperture more desirable for JPG shooters.
    Thanks Again,
    Bob

  • Upload file size in browser side

    Is there a way to detect the size of the attached file in the browser side, before to send this file to a servlet? If yes, how to?

    Yes u can do that pls check this and let me know...
    did it serve the purpose
    <HTML>
    <HEAD>
    <SCRIPT>
    function getImageDimension (imgURL, loadHandler) {
    var img = new Image();
    img.onload = loadHandler;
    if (document.layers
    && location.protocol.toLowerCase() != 'file:'
    && navigator.javaEnabled())
    netscape.security.PrivilegeManager.enablePrivilege(
    'UniversalFileRead'
    img.src = imgURL;
    function getFileSize (fileName) {
    if (document.layers) {
    if (navigator.javaEnabled()) {
              alert('inside');
    var file = new java.io.File(fileName);
    if (location.protocol.toLowerCase() != 'file:')
    netscape.security.PrivilegeManager.enablePrivilege(
    'UniversalFileRead'
    return file.length();
    else return -1;
    else if (document.all) {
    window.oldOnError = window.onerror;
    window.onerror = function (err) {
    if (err.indexOf('utomation') != -1) {
    alert('file access not possible');
    return true;
    else
    return false;
    var fso = new ActiveXObject('Scripting.FileSystemObject');
    var file = fso.GetFile(fileName);
    window.onerror = window.oldOnError;
    return file.Size;
    function showImageDimensions () {
    alert(this.width + 'x' + this.height);
    </SCRIPT>
    <SCRIPT>
    function checkImageDimensions (fileName) {
    var imgURL = 'file:///' + fileName;
    getImageDimension(imgURL, showImageDimensions);
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="formName">
    <INPUT TYPE="file" NAME="fileName">
    <BR>
    <INPUT TYPE="button" VALUE="check file size"
    ONCLICK="alert(getFileSize(this.form.fileName.value))"
    >
    <BR>
    <INPUT TYPE="button" VALUE="check image dimensions"
    ONCLICK="checkImageDimensions(this.form.fileName.value)"
    >
    </FORM>
    </BODY>
    </HTML>
    --------------------------------

  • File receiver - Get file size

    Hi all,
    In my scenario, the message mapping is such that the target message may or may not have child nodes created depending on certain conditions. I am using file receiver channel to write this target message as xml file on another server.
    The issue I am facing is - suppose child nodes are not created, the target message has only root node, and nothing else. i.e. it is empty.
    But still the file gets written on destination, because file adapter doesn't seem to have intelligence to look into the payload. So I have to manually delete such 'almost-empty' files.
    Although PI 7.0 has feature of ignoring empty files, the file I am talking of is really not of 0 kb size, as it contains namespace and root node tag. It has very small size of 1 kb, this is fixed and thus the file is easily distinguished from other larger files which contain child nodes. File size is a parameter that can be certainly used as a key here, but don't know how.
    Does anyone have any idea on -
    1) How to check file size before file receiver adapter writes it,
    2) How to prevent such file from getting written, or
    3) run a script which can detect the file size and delete them periodically / or every time file receiver writes files ?
    Regards,
    - Shankar.

    Hi,
    We have an option of empty file handling in receiver file adapter..
    <i>      Select the Handling of Empty Messages:       Write Empty File
    An empty file (length 0 bytes) is put in the target directory.
           Ignore No file is put in the target directory.</i>
    But your case namespace and root node only are available you said.
    In this type of situations ..
    We can handle in the following way..
    If target side root node having the recordset node
    root
      recordset 0..unbound
         child1 0.1
         child2   0.1
    Then create a UDF
    map from left side one node -
    exists --- UDF ---to right side root node
    In UDF
    //handle business logic and
    ....ResultList.SUPPRESS.
    if your target side does not have any recordset type of structure then..
    In messages tab change the occurrences of msg to 0..unbound and use the above UDF.
    Regards
    Chilla..

  • Action to export with maximum file size

    I'm looking to export a whole load of images that must not exceed 20Mb. I'm sure this is possible to set up, but how?
    Thanks in advance

    Photoshop simply doesn't give you a "target size or smaller" capability directly, so folks are trying to be creative in helping you.  A simple "Thanks, but I really need these big files" would do. 
    Keep in mind there are a lot of folks using Photoshop who don't know the difference between "JPEG file size on disk" and "photographic file size".  If you want folks to understand that you DO know better, consider writing more than a single sentence in your original post.  Expecting people to assume you're an expert right after posting a basic question seems a bit of a stretch.
    You're saying that, with an RGB 8 bits/channel image, do File - Save As, choose JPEG, then look at the estimated file size in the JPEG save dialog and adjust the quality level - because it's manual - isn't good for you.  You need automation.  Fair enough.
    Chances are you could do something with Photoshop's Scripting facility.  I imagine it might have to be iterative (e.g., pick a quality level, save, check file size, adjust quality level, repeat...).  The forum for that is down the hall.  There are some very talented people there who give freely of their time.  Please try not to insult them.
    http://forums.adobe.com/community/photoshop/photoshop_scripting
    -Noel

  • Regarding to file size

    Hi friends:
    I use ls -ltra to check file size get result like this
    -rw-r--r-- 1 oracle dba 4700368020 Feb 11 00:33 xxxfilename Feb07.dmp.Z
    i think its size should be 4700368020 (4.7G) after compress. then ftp to another server tem file for imp. The tmp file size is only 2860976000 (about 2.8G) free available, so i think the ftp should be failed because tmp is not big enough to hold.
    but it succeeded for yesterday loading.
    so, could you tell me if 4.7G is after compress size or before compress size?
    if it is before, then compressed size should be 1/3 of noncompress. then that is why it succeeded.

    Hi,
    >>i think its size should be 4700368020 (4.7G)
    4700368020 bytes = 4,37 GB
    Now, can you clarify what do you mean when you say about "after compress size or before compress size" ?
    Cheers

  • How can I batch resize images to a file size of 1 meg?

    I'm not the most technically literate mac user and would gratefully receive any help please.
    I have been asked to reduce lots of images of various large file sizes and dimensions to 1 meg. I am using Photoshop CS4 and am aware of the 'Image Processor' function under 'scripts' unfortunately it only allows me to adjust the image dimensions, but I need to reduce the file size so that every image is 1 meg and at 300 dpi, it doesn't matter about the image dimensions.
    Thanks so much!
    Jess

    You omitted to name the file format you want to use.
    If you use any compression the task is far less trivial than you might think.
    Trying to predict the effect of the compression (even if it were non-destructive) is not always sensible so the viable approach may be to save, check file size, if above intended one change dimensions, save, check file size etc.
    I think I have come across thread/s on this in the Scripting Forum but I can’t remember anyone ever posting a finalised Script for this.

  • How to check the file size before loading it to the context

    Hello,
    I have an application to upload a file and write it to the server using the FileUpload UI and IWDResource Interface.
    I would like to limit the size of the file the user is uploading to, say, 2MB.
    The problem is that the current API doesn't allow me to check the file size before I store it in IWDResource. The API available for IWDResource:
    IWDResource resource = ...
    InputStream stream = resource.read(false);
    size = stream.available();
    Is working on the file only AFTER storing it in the context and the server's memory. This way, if a user decides to upload 1GB file for example, he can easily crash the server.
    I am already familiar with <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71">this</a> arcticle but it doesn't answer this question as well, all it does is calculating the file size only after storing it in the context.
    Any ideas...?
    Roy

    Hi Ram,
    Have you activated your Objects ?
    You need to activate your objects in order to see them in RWB.
    Thanks & Regards,
    Varun Joshi

  • Does anyone know why I get varying file sizes when I save a jpg (with same settings-None, 12, base "standard", preview checked) from PhotoshopCS5?

    I opened a .psd file (300 ppi, CMYK, .jpgs (1626px x 2130px), I saved it as a jpg (None, 12, base "standard", preview checked).
    I then closed the original .psd file.
    I repeated those steps on the same file and saved a series of 6 .jpgs.
    Of those 6 files, I received 2 large files (6.2MB) and 4 smaller (3.2MB) files.
    My coworkers who were having trouble opening some of my jpg images in Windows Photo Gallery on Vista OS were able to open the smaller files but not the larger ones.
    Do you have any idea why the same settings would give me different file sizes from CS5?
    Is there a way I can make it consistently keep the smaller more compatible version?

    How well a image data compresses depends on image content.   Image with High detail do not compress well image will little detail will compress well and the file size will be small. Compare a image of a blank white wall to a wall with a black and white checker board wall paper.  One is all white it white no other detail  to detail the other has squares that vary in size because of perspective angle and distance a lot of detail must be recorded.
    I do not know why they can not open some of your images. File size should not be an issue.   All your image decoded are the same size  Width number of Pixels Height numbers of pixels background layer only for these are jpeg files.

  • Check image details like resolution, dimensions, color mode, file format, file size and file name

    I have 1000 images in a folder, i want to check their details like resolution, dimensions, color mode, file format, file size and file name into excel with nice user interface.
    Pls help me, m just learning ABCD in VB.

    The code in the file at the link below might give you a starting point. Firstly it gives you the opportunity to list all of the properties of a file type and then you can select the properties that you want and the second utility gives you the
    opportunity to list the selected properties for all files in a selected folder.
    Download and extract the file and open the file in Excel.
    Click the first button List Meta Data for One File (Run first)
    Navigate to and Select any ONE individual photo file. (Photo files because that is what you indicated you are working with.)
    You will be presented with a list of the available properties for the file. Where the Item value is blank, that property is not recorded for the particular file. Different file types have different properties and it is also dependent on how the file
    was created but generally if all of the files come from the same source then the same properties are recorded for all files from that source.
    Now insert a Y in column D for all of the required properties. (Don't select any with the Item value blank)
    Click the second button List Selected Meta Data for all Files in a Folder (Run after selecting the required properties).
    Next select a folder where the files reside. (You might need to back up to the folder if dialog is blank because it will not show individual files because the code only allows Folders.)
    You will be presented with a report listing all of the selected properties for all of the files in the selected folder.
    The user interface is not that great but you can improve on that if you want to with a Userform as you get to know VBA a little better.
    Download the file from here.
    https://onedrive.live.com/redir?resid=C2A7A5912D3D17B0!273&authkey=!ANf8R0Xf0-h3wJ8&ithint=file%2czip
    Regards, OssieMac

  • Checking the file size

    Hi all. Can anyone help me how to check the size of a file using Oracle 10gR2?
    Thanks.

    You could use UTL_FILE. FGETATTR.
    This procedure reads and returns the attributes of a disk file.
    Syntax
    UTL_FILE.FGETATTR(
    location IN VARCHAR2,
    filename IN VARCHAR2,
    exists OUT BOOLEAN,
    file_length OUT NUMBER,
    blocksize OUT NUMBER);
    Parameters
    location: Directory location of the source file, a DIRECTORY_NAME from the ALL_DIRECTORIES view (case sensitive).
    filename: The name of the file to be examined.
    exists: A BOOLEAN for whether or not the file exists.
    file_length: The length of the file in bytes. NULL if file does not exist.
    blocksize: The file system block size in bytes. NULL if the file does not exist.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#i1003488
    More examples regarding UTL_FILE can be found here (amongst others):
    http://www.oracle-base.com/articles/9i/UTL_FILERandomAccessOfFiles9i.php

Maybe you are looking for

  • Variation on itunes 6.0.1 (3) problems

    My new 6.0.1 (3) works just fine in all respects EXCEPT that the program crashes when I try to connect to the music store, or, to update a podcast. I haven't had the whole computer crash like others have, and I haven't lost the library, as have other

  • How do I prevent non-admin users from putting Lion to sleep?

    I share a MacPro at home with a few others.  I use it as a server as well as keep content on it that is streamed to all sorts of devices; they use it as a mac to check e-mail.  Two of the users have a really bad habit of putting it to sleep because t

  • Getting text ID and Text object  associated with item texts in PO...

    Hi, To print standard text on smartform for a given item in purchase order, I need to find the text ID and object associated with it. There are various texts like item text, Info record PO text, Material PO Text, Delievry Text, etc... Now when I go t

  • Customerexit for Nonmoving items

    I need a code for nonmoving items I am crating a customer exit variable for Material Can any one provide the code for this After material comes to the plant if that particular material is not moving from 1 year then its issued value stock (0issvalstc

  • Mail crashes when adding new account

    Hi everytime I try to add my email account it crashes, I fill in all the details, incoming outgoing server etc and when I press continue it crashes. Every time. I have searched the net but getting no where. Can you help ? Macbook pro, snow leopard, 1