Files Question

hey i have a program that needs to do this (this just makes a good example, my actual code is going to be more complex) but lets say i have an unknown number of .dat files in a given folder and each contains a string in the first line, i need to be able to specify the folder and have it print out all of the strings in one line. can anybody atleast point me in the right direction? also the .dat's will have unknown names

java.io.File has a method named listFiles which accepts a FilenameFilter as a parameter. Use it on the directory to find the files you want.
See http://java.sun.com/javase/6/docs/api/java/io/File.html#listFiles(java.io.FilenameFilter)

Similar Messages

  • CGI map file questions, help !!!

    I am trying to use the CGI map file to open web reports. I got two questions at this time.
    1. How to refresh the report to reflect resent edits ? I used the CGI map to open a report. Later, I made some edits to the report and opened it again. However, the browser showed the report before the edit. I had to save the report to different file name and edited the key in the map file to show the edited report. This should not be the right way.
    2. How to open a report on a separated screen which is on top of the original one ?
    Any suggestions? Thanks!
    null

    Hi Kate.
    As far as a find and replace tool is concerned, most of us
    here prefer using some tool such as FAR or BkReplacem as they offer
    more features to help in this kind of scenario. The simple answer
    is however that these tools, as indeed does the inbuilt tool, bases
    it's search on the HTML. Therefore if there are specific instances
    of HTML strings you will have to analyse carefully them before you
    replace anything. It sounds like you are already some down down
    this line. Take a backup of your project and test out your theory.
    As far as your map file question is concerned, you can safely
    reimport your map file PROVIDED that no changes have been made to
    the mapids in the meantime. Personally I wouldn't do this unless
    you are 100% sure of this. If it is a case of having 100s of topics
    that are not mapped and never have been but could be, I'd just
    create a new map file and map away.

  • Flat File and Control Files Questions

    Greetings,
    I've worked with Oracle for about 10 years, but have little experience with using sql-loader.
    I have data from Visual FoxPro tables going into Oracle 10g via a Perl script. I am having issues and therefore have a couple questions.
    1) If the data from my foxpro table is basically everything in the table as in 'Select * from table-name', does the control file have to list every column that is in the FoxPro table?
    -- I have a case where a FoxPro table has 15 columns but we are trying to upload only 10 columns. The script is dynamic. It selects * from each FoxPro table and creates a Flat File for each on the fly. Then sql-loader uploads the data to Oracle. The Flat File for this one table has data from all 15 columns, but the Control File only lists 10 of the columns to be uploaded into Oracle.
    2) Do the column names in the control file 'have' to match both the column names in the FoxPro table and the Oracle table, or only the Oracle table?

    YankeeFan wrote:
    Greetings,
    I've worked with Oracle for about 10 years, but have little experience with using sql-loader.
    I have data from Visual FoxPro tables going into Oracle 10g via a Perl script. I am having issues and therefore have a couple questions.
    1) If the data from my foxpro table is basically everything in the table as in 'Select * from table-name', does the control file have to list every column that is in the FoxPro table?
    -- I have a case where a FoxPro table has 15 columns but we are trying to upload only 10 columns. The script is dynamic. It selects * from each FoxPro table and creates a Flat File for each on the fly. Then sql-loader uploads the data to Oracle. The Flat File for this one table has data from all 15 columns, but the Control File only lists 10 of the columns to be uploaded into Oracle.
    Yes - use the FILLER spec to ignore columns you do not care about - http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#sthref946
    2) Do the column names in the control file 'have' to match both the column names in the FoxPro table and the Oracle table, or only the Oracle table?Only the Oracle table.
    HTH
    Srini

  • Simple nib file question

    I believe that all the examples I've seen of nib/xib files have been connections to the corresponding controller or view files, or to the app delegate and the main window,
    Please correct me if I'm wrong, I might just be tired and missing an important clue
    I'm using a Utility Application template, and have most of my work done using the MainView and MainViewController. I'd like to now work on the FlipsideView and FlipsideViewController to display and/or manipulate status and options, which is already in instances/classes in the MainView and MainViewController type.
    How do I access data in the other View, ViewController, or app delegate by connecting buttons and fields from my FlipsideView?
    This may be a "duh! Oh Yeah" question/answer, as in just examine how the FlipsideView is connected to the MainViewController. However, I could use a little leading and pointing here.
    In my test app, I've already created a number of labels for static info, or to hold the value of a field in the other class instances. I'm just trying to figure out how to make the connections. I do have a few of the data elements setup with IBOutlets already.

    When the controllers of separate nibs need to communicate with each other, the best solution depends on the structure of the program and how many controllers are involved. Luckily the discussion gets much easier if we restrict it to the nibs in the Utility template. However, the Utility template that came with SDK 3.0 is quite different from the 2.x version. I'll start with 3.0.
    With the 3.0 Utility template you have a built in communication channel because the flipside view controller is the modal child of the main view controller. That means flipsideViewController.parentController points to mainViewController. And mainViewController.modalViewController points to flipsideViewController.
    So for example, if textField1 is in the main view, and label1 is in the flipside view:
    // in FlipsideViewController.m
    self.label1.text = parentViewController.textField1.text;
    Note however that communication in the other direction is limited to the time the flipside view is active. While mainViewController will always exist when the flipside view covers it, the flipsideViewController is released when its view is dismissed. So in order to export info from flipside to main, you might have the flipside controller save the data ahead of time. For example if the mainViewController needs the text from label2 which is on the flipside:
    // in FlipSideController.m
    parentViewController.copyOfLabel2 = self.label2.text;
    You also mentioned getting data from the app delegate. The app delegate is accessible from any object in the program precisely because it's "the shared application object's delegate". So for example, if mainViewController is an instance variable (with a matching property) of the app delegate, a method of any object in the program could obtain a pointer to the mainViewController, and thus any objects in its view:
    // in AnyClass.m
    #include "MyAppDelegate.h"
    #include "MainViewController.h"
    - (NSString*)getTextField1 {
    myAppDelegate *delegate = [UIApplication sharedApplication].delegate;
    MainViewController *mainViewController = delegate.mainViewController;
    return mainViewController.textField1.text;
    The solution for the 2.x version of the Utility template is based on the fact that both the main and flipside controllers are children of a root view controller. I'll wait to find out which version you have before dealing with the 2.x template.
    Hope that helps!
    - Ray

  • Classpath and jar file question

    my application need to use few jar files i downloaded from the internet
    so i need to set the classpath so that i can import the packages in the jar file rite?
    let say set classpath=.;c:\somedir\bin;
    the ".;" after the "=" means that i search the current directory first then search the directory i have specified after that rite?
    if so, can i put all the needed jar files in the current directory so that my application can use them??
    Another question is if all the jar files in located in the same directory how can i set the class path to refer to them without sepecifying each of the jar file name??can i just put the directory path and will it locate them automatically when my application start??
    can anyone tell me about it??thanks

    No, you need to include each and every jar file in your classpath.
    Or put them all in your <jdk_installation_dir>\jre\lib\ext directory, so that they will get included in your classpath automatically.
    Sudha

  • IPhoto file questions

    Hello! I am new to Macs. Having recently switched from a PC to a Mac, I am a little confused by the file management.
    Every time I import photos using iPhoto, where are the files saved?
    If I want to copy, email, or open photos using any non-Apple software (say, my email in Safari), how do I find the uploaded photos?
    I apologize if these questions have been asked before, and I thank you for your reply.

    . To access them, control-click it in the Finder and choose Show Package Contents. Don't change anything inside.
    This is not a supported way to access the files.
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • Renaming files question

    I am new to Lightroom and have a file naming question. I previously used Capture NX2 to import and rename my files. My convention is "YYYY-MM-DD-HH-MM-SS-JAH".
    Capture NX2 had an option where it would add a "-n" after the seconds field (SS in above) and before my initials (-JAH in above). This way, if there multiple pictures within the same second, they would be sequentially numbered. This would avoid overwriting the first image with subsequent ones that would have the same name.
    I have not found a way within the Lightroom 3.4.1 naming capabilities to replicate this convention. Am I missing something, or does anyone have a workaround they have discovered.
    Thanks,
    Jim

    Thanks very much Lee. I will give it a shot.
    Regards,
    Jim

  • Sql loader control file question.

    I have a text file (t.txt) which contains a record types AAA and AAB to input fixed width data into a table (t) AAA_NO, AAA_TYPE, AAB_DESC.
    Control file (control_t) contents:
    load data infile '/path/t.txt'
    insert into table t
    when ((1:3) = 'AAA' )
    AAA_NO position (4:14) CHAR,
    AAA_TYPE postion (15:27) CHAR
    Works prefectly, but I need to add another set of data from the same t.txt file with record type AAB. I attempted to add this into the same control file:
    into table t
    when (1:3) = 'AAB'
    AAB_DESC position (28:128) CHAR
    It fails naturally. How would I include the addtional record type data into the same table after AAA_NO and AAA_TYPE have already been inserted? Do I need to include the AAA_NO in the second insert (AAB_DESC)? Should I create another temp table to store only the AAA_NO and AAB_DESC and then insert that data into table t after the loader is done? Or can this be completed in the same control file?

    Thanks again for the assistance, this is a tough one to fix. I am new to sqlloader.
    The temp table creation is causing some serious errors, so I am back to trying to fix sqlloader to get the job done. the apt.txt file contains records that each row of a new record starts with either 'APT' or 'ATT'. Here is the details of what I am trying to do.
    crtl file:
    load data
    infile '/path/apt.txt
    insert
    into table t_hld
    when ((1:3) = 'APT')
    apt_no position (4:14) CHAR,
    apt_type position (15:27) CHAR,
    apt_id position (28:31) CHAR
    The next section is the problem where I am inserting apt_sked into the same table t_hld as above because it has a different record qualifier its ATT and not APT.
    insert
    into table t_hld
    when (1:3) = 'ATT'
    apt_no position (4:14) CHAR,
    apt_sked position (16:126) CHAR
    The positions of the data using fixed is working, I can insert the apt_sked data into another temp table instead of t_hld and it works. It's just when I attempt to place the ATT apt_sked data into the t_hld table after the APT data has been loaded into the t_hld table....I tried APPEND instead of INSERT, but that does not work.
    The APT_NO's of the data are all the same- it is the qualifier for the records (Primary Key attribute- however I do not have it established since it is a temp table concept).
    I am stuck trying to get the data in the t_hld table, everything works when I do not try to put the ATT apt_sked data into t_hld- everything is valid. And placing the ATT apt_sked data into a different temp table works perfectly- but I can't find a way to create an update to t_hld from this temp table without errors. So I am trying to go back to sqlloader to get this done- any thoughts or questions?
    Thanks a billion!
    Shawn

  • Batch file question.

    I am not sure this is a place to post my question. but i don't know where to post it , so i decide to post here.
    yeah, I have a question about is that possible to creat a batch file to open the command prompt? like create a batch file and when you double click on it. it open up command prompt?
    if any one can supply me any website to learn the batch file. that would be really helpful. thank you so much

    @ECHO OFF
    REM This is a batch file that opens up a command line window
    cmd /KAs for the websites, here's one:
    www.google.com

  • Backing file question

    Very basic question
    I have three page --page 1 , page2 and page 3
    I have attached the below backing file to page2
    The println statement always says curPage to be page2 even when I click other pages (page1 and page3) I;m not clear why backing file is executed when page 1 and page 3 is clicked. any pointers?
    package age;
    import com.bea.netuix.servlets.controls.page.PageBackingContext;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class testPageBackingFile extends com.bea.netuix.servlets.controls.content.backing.AbstractJspBacking
    public boolean handlePostbackData(HttpServletRequest request, HttpServletResponse response) {
    PageBackingContext testContext = PageBackingContext.getPageBackingContext(request);
    String curPage = testContext.getLabel();
    system.out.println("curPage" + curPage);
    String newPage;
    try {
    Integer.parseInt(request.getParameter("age"));
    newPage = "page5";
    } catch (NumberFormatException nfe) {
    newPage = "page2";
    if(!curPage.equals(newPage)) {
    testContext.setupPageChangeEvent(newPage);
    return true;
    } else {
    return false;
    }

    Hello,
    Unless "Control Tree Optimization" is turned on, the handlePostbackData() method of every backing file in the whole desktop will generally be run, even if the page / book / portal the backing file is attached to is not being displayed.
    Kevin

  • Gradient has stripes & workflow of save as web file question

    Hi! Working now with AI CS6.
    I have a gradient with 3 colours, but unfortunatly you can see stripes within the gradient, like it is devided in many little steps.
    Any ideas how to solve this? The gradient should be very, very smooth.
    Second question concernes the workflow of saving as web file.
    In AI CS5 it has been easy to scale a grafic item in its meassures in the dialog "save as web file".
    Just tiping the new messures for instance 100 instead if 50 px, click an then the preview of the file in the new size appeared at once.
    It changed somewhat in AI CS6, the preview doesn`t seem to work properly. Annoying!
    Am I am doing something wrong?
    Help is most welcome.
    Thanks a lot!

    For the first question, what is your screen resolution and number of colors being used? Please check if you're using low screen resolution of number of colors in display settings. Increase it to the best possible. On Windows 7, calibrate your display again and check.
    For your second question, try pressing tab and Shift tab keys after modifying the numbers and switch between Width and Height until you see the changed preview. In CS6 the apply button was removed which is causing this issue. This has been noted in other forums as well. http://forums.adobe.com/message/4730659#4730659

  • EDL vid track and source file questions..

    Can some one confirm and advise on this please.
    PPRO can only export an EDL from a single Video Track ( you can choose which one).
    Odd thing is that it recognises Vid 1 and Vid 2 as a single video track ( maybe a hangover from early iterations of PPRO when it was an A/B style timeline)
    How does one suggest exporting EDLs from a sequence with multiple Vid tracks?     ( I am thinking I will have to collapse everything to Vid 1 & 2  but that is so inconvenient and complex... and I have 15 sequences to do).
    Heres the next little EDL gottcha...( well it got-me) anyway
    I shot AVCCAM (avchd)  to a different card each day.  ( This is a Caution to anyone using AVCHD)
    Unlike the elegant P2 file unique name protocol...I  now have  source file names that are identical  eg 00001.mts, 00002.mts, 00003.mts  ....in the same project
    (AVCHD resets the .name clock.!!!)
    Easily managed in my NLE system ( Rushes 1 and Rushes 2 source Folders)  no issue there... but it will get real interesting when I have to output edl and source files for Da Vinci Resolve and Flame Suite (next week).
    Any ideas guys...

    I have never worked with EDL, but two questions/wild-shots-in-the-dark:
    - Export an EDL from each track, and then combine the EDL's in the target app?
    - Nesting, is that possible? (nest a multi-track sequence into a new one-track, and export an EDL from that)
    Probably you see that I don't do to much broadcast work, so please excuse me if I'm way off...
    Dag

  • "Find" file question

    Hi:
    As all can see, still learning the subtle nuances of 10.4. so here hopefully is a simple one.
    Not at all new to the mac interface, but when going to find something, first off the "Find New" window has the following search options "Computer" "Kind" and "Last Opened". I almost always use "Name". Any way to switch the default?
    Secondly, when searching for "Name" and I have a file on my desktop named for instance "smallplan.psd" the search comes up empty. I'm searching "Computer" then tried Computer, Home and Volume - same thing.
    Any suggestions? TIA and Happy Holidays.

    Ah, I get you now, Murman. That question/problem has come up before. Unfortunately, I don't remember the answer, or if one was even found. It may have to do with a damaged Spotlight index.
    Try downloading Spotless. I liked this shareware so much, it's one of the handful I've purchased. It's a bit more of a nuisance to use the unregistered version, but all of the functions are there. You can do two basic things.
    1) Delete all existing Spotlight index files on all or some drives. This will force Spotlight to rebuild them.
    2) Delete the index files and turn Spotlight off completely.
    I prefer the second one, which is different from making a drive private in Spotlight's preferences. If you do that, neither Spotlight or the Command+F finder window will return any matches on a drive marked as private. But if you use Spotless to simply turn off Spotlight's ability to index a drive and delete the indexes, then the Command+F finder window behaves like the Finder of old.

  • Trigger file question

    I was wondering if you could provide me some information about trigger files and how they can be sent (or retrieved).
    I created a daily Informatica process that runs at 8 AM, Monday – Saturday, on the dev server. It uses loans_daily_pub_vw and loan_txn_detail as sources. I’d like to include a process that checks trigger files, in case there are any delays in the loads.
    My questions are:
    Are trigger files created when the loans-daily and loan-txn-detail process complete?
    What is the best practice for sending trigger files?
    Can they be ftp’d to another server, or is there an alternate method?
    Thanks

    this is not an oracle question.
    this is an application design issue. if you want to use trigger files (or feel you NEED to because of the limitiation of a legacy system), then you'll need to design and code it.
    from oracle, you might want to use UTL_FILE to create files. DBMS_JOB or DBMS_SCHEDULER (v10) to schedule/run stored procedures. You could use external tables to read in files. and you can use DBMS_SCHEDULER on v10, or stored java procedures on v8-9 to issue o/s commands from oracle.
    Are trigger files created when the loans-daily and loan-txn-detail process complete?
    you decide
    What is the best practice for sending trigger files?
    there aren't any
    Can they be ftp’d to another server, or is there an alternate method?
    depends on how your network is setup, and what's installed on your servers

  • AM Client java file question.

    Hello,
    I am learning OAF, when configured an AM to expose methods by Client Interface, a java file is created under /client, a reference is also made in the AM.xml:
      ComponentClass="...server.PeRatingAMImpl"
       ComponentInterface="...server.common.PeRatingAM"
       ClientProxyName="...server.client.PeRatingAMClient"The questions:
    1. Do I have any use for ClientProxyName java file or it is there to serve as adapter/glue code between my interface (AM.java and AMImpl.java?
    (Depends on answer to Q1)
    2. I'm suppose to use in my controller the AM.java, or the generated AMClient?
    Thanks in advance.

    What you will do in your controller is get a reference to the AM via the pageContext object.
    Like this:
    OAApplicationModule am=(OAApplicationModule)pageContext.getRootApplicationModule();
    Use the am ref to call methods in the am.
    Kristofer Cruz

  • Another .avi file question

    Hi there,
    I opened a quicktime movie in Mpeg Streamclip and exported to avi file.
    I then burned it off onto iDVD for a customer. However, she could not open it as an .avi file from her PC (to put into power point) is there any way I can burn off a DVD in iDVD that allows another to extract the .avi file as an .avi file?
    Thanks for any help!

    .. thanks, what do you mean by PC compatible disc? ...
    typical Mac-user question.. ;)) a Mac 'eats' all formats, a PC not.
    depending on how or with what your burning a dataDisk, you are allowed to select a disk's 'format' ... if you're using the Finder (insert dvd-r, drag content on it, burn..) it will care to choose a format, a PC is able to read it ...

Maybe you are looking for