Read a folder and contents into memory

Hello All,
I want to put an entire folder (and it's contents) into memory.
Use Case :
1) Computer 1 has a folder called "foo" with 5 files in it. I want to run some program here which will serialize down into some file call it "fooserialized"
2) Computer 2 deserializes "fooserialized" and can then create folder "foo" with all of it's original contents.
Any suggestions? I browsed through the java.util.zip package with no avail.
Thanks!
TheCypher

I want to do this simply as possible.tar cfj archive.tar.bz2 <files>
<send to other computer>
tar xfj archive.tar.bz2

Similar Messages

  • Loading a Video TS folder and contents into FCP

    I have some video on a disc from a Canon DC201. When I look at the disc it contains a folder named VideoTS. Is it possible to use the files in some way in FCP? How can I load the video?
    Thanks,

    Kerno-Kid wrote:
    I have some video on a disc from a Canon DC201. When I look at the disc it contains a folder named VideoTS. Is it possible to use the files in some way in FCP? How can I load the video?
    Thanks,
    Hope this may help,
    VIDEO_TS is a folder that contains many other files inside, like VOB (movie), INFO (info), BUP (backup). FCP is movie editing application, so..
    1. FCP can edit VOB (=MPEG2) if you have QT MPEG2 component & the right audio component.
    2. another way, open VOB file with mpeg streamclip (or others) & convert it into DV. FCP is sure can understand it.

  • How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi?

    How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi? There is probably a trivial, easy way to get this info, but I have not yet found it!  Thanks..

    Or if you want to grab all the paths programatically, try the attached VI.
    Open the top level that you want all the paths from and close all others, then open the
    attached and run it. It will return an array of all the VIs that the VI
    in question uses, including vi.lib VIs. You can filter these as well if
    you like.
    Ed
    Message Edited by Ed Dickens on 08-01-2005 07:01 PM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Get all paths.vi ‏29 KB

  • Possible to set it so you can't delete a specific folder and contents...

    Hello.
    I'm wondering if anyone knows a way I can set a folder so that a user can't delete the folder (and thus, the contents by deleting that folder). But, at the same time, I want them to be able to manage the items within the folder (ie. can delete sub-folders, can add sub-folders, etc.).
    Basically, right now each computer in the studio has a "jobs" folder. This folder gets backed up (via the network via Retrospect) each night and users can add/delete jobs as they want. But, they can also accidentally delete this folder by having selected the main folder itself and hitting command-delete, or by moving it to the trash. I know it's not "likely", but it is possible and I'm hoping to prevent it.
    I thought I could lock the folder so you can't delete it, but this seemed to also make it so the user can't add files either.
    So, wondering if anyone has any suggestions (native or 3rd-party)?
    Thanks,
    Kristin.

    If I create a temporary directory owned by me and grant read/write/execute permission to me, my group and others, I can add and delete items inside it but I cannot remove the directory itself while working as another user. If I gave ownership of the directory to root, I would also be unable to remove it.
    While this is not secure - certainly admin users could delete the directory itself if they wanted to - it should prevent accidental removal of the sort you describe. Check it works on 10.5, though.
    - cfr

  • Reading a text data file into memory

    hi,
    I have a text file which contains data, The text file is parsed and objects are created. The problem is the text file is quite huge measuring upto 1.8~2 Mb. The format of the text file is as follows
    Units: METRIC (atm, m3)
    * Step: 1 Time: 0.00
    * Average Field Pressure : 204.14
    * Region 1 Pressure : 204.14
    Well GROUP Layer Blk_Pressure BHP ResRate OilRate WaterRate GasRate KhProd Windex PindeWELLTYPE
    1 FIELD 1 204.14 49.33 6601.22 6568.10 37.14 538.07 99999.00 260.35 99999.00 P
    1 FIELD 2 204.14 50.34 6558.13 6525.23 36.90 534.56 99999.00 260.35 99999.00 P
    1 FIELD 3 204.14 51.35 6515.04 6482.36 36.65 531.04 99999.00 260.35 99999.00 P
    1 FIELD Tot 204.14 50.34 19674.40 19575.69 110.69 1603.67 99999.00 99999.00 99999.00 P
    2 FIELD 1 204.14 377.66 7573.96 0.00 7403.68 0.00 99999.00 260.35 99999.00 I
    2 FIELD 2 204.14 378.40 7606.33 0.00 7435.32 0.00 99999.00 260.35 99999.00 I
    2 FIELD 3 204.14 379.14 7638.70 0.00 7466.96 0.00 99999.00 260.35 99999.00 I
    2 FIELD Tot 204.14 378.40 22818.99 0.00 22305.95 0.00 99999.00 99999.00 99999.00 I
    * Step: 2 Time: 20.23
    * Average Field Pressure : 300.11
    * Region 1 Pressure : 300.11
    Well GROUP Layer Blk_Pressure BHP ResRate OilRate WaterRate GasRate KhProd Windex PindeWELLTYPE
    1 FIELD 1 194.20 49.33 858.83 853.40 5.36 68.22 99999.00 260.35 99999.00 P
    1 FIELD 2 194.48 50.34 871.71 866.22 5.42 69.35 99999.00 260.35 99999.00 P
    1 FIELD 3 194.76 51.35 884.86 879.29 5.48 70.49 99999.00 260.35 99999.00 P
    1 FIELD Tot 194.48 50.34 2615.40 2598.91 16.26 208.06 99999.00 99999.00 99999.00 P
    2 FIELD 1 370.40 377.66 912.25 0.00 891.74 0.00 99999.00 260.35 99999.00 I
    2 FIELD 2 371.26 378.40 895.75 0.00 875.61 0.00 99999.00 260.35 99999.00 I
    2 FIELD 3 372.12 379.14 879.29 0.00 859.52 0.00 99999.00 260.35 99999.00 I
    2 FIELD Tot 371.26 378.40 2687.28 0.00 2626.86 0.00 99999.00 99999.00 99999.00 I
    The Step goes on till like 3000, I am creating an object for each step which inturn has nested object for each well and the well in turn for each layer. In the above case of step 3 the object would be
    class Step 2{
    inner class well
    {     //for well 1
    inner class layer { // for layer 1 }
    inner class layer {/ for layer 2  }
    inner class layer {/ for layer 3  }
    inner class well
    {     //for well 2
    inner class layer { // for layer 1 }
    inner class layer {/ for layer 2  }
    inner class layer {/ for layer 3  }
    This architecture of mine is proving to be heavy as I would end up with around 9000 Java objects in memory, though my classes only have have int, float, String data items. I am using this data to plot graphs, so I guess it wouldnt be optimal to read data from text file for each plot.
    So in short the problem is can anyone tell a better way to read the data into memory ? given that there could be 3000 steps in the format given above.
    Thanks
    AM

    I have implemented and it takes around 30-45 sec to parse and also the GUI has become very slow. I query the objects for multiple combinations of graphs.
    The data from the objects is being used to feed the graphs on my GUI. I have a number of options on my GUI for different kinds of graphs, for each combination chosen the Objects are queried for the data. The GUI is written using Swing.
    So is there anyway I can fine tune the application, any tips about the object architecture or how to improve the speed. I am also explicitly running the garbage collector a few times in my program. Also how can I make JVM occupy lesser memory so that my program can have more memory.
    Thanks
    am

  • Read text file and insert into MySQL

    Dears,
    I need to read text file and then insert the data in the correct column in the MySQL database
    example
    I have the following text file:
    field1=1234 field2=56789 field3=444555
    field1=1333 field2=2222 field3=333555
    and so on and so forth ,,note that all rows are identical and just the filed value is changed(there is a dilemeter between fields)
    how can I read field1,field2 and field3 from text file and insert them in the correct table and column in the database.....
    any help?????
    thanks for your cooperation
    Best Regars

    Sure.
    Which part don't you understand?
    1. Reading a text file
    2. Parsing the text file contents.
    3. Relational databases and SQL.
    4. How to create a database.
    5. How to connect to a database in Java.
    6. How to insert records into the database in Java.
    7. How to map Java objects to records in a database.
    This is a pretty nice list. Solve complex problems by breaking them into smaller ones.
    %

  • Copy Workspace folder and contents

    I would like to copy all files and folders in a folder on the Workspace to another folder on the Workspace. What's the best way to do this?
    I'm using Hyperion Reporting and Analysis Workspace 9.3.3.

    Hi Dougp,
    I guess you want to restructure the folder view in work space,, if I am right,,
    all you have to do is to simply use copy and paste action to move the folders and what ever insides of the folders.
    Just right click on the folder or the contents in side the folder and copy them, then you can paste it either at
    top level of the tree or any of the below levels.
    If you want to move the folders in b/w the environments I suggest to do Export to file system-->FTP to target server-->Import from file system.
    If you want to do export & Import b/w environments make sure the database connections on the target workspace are set up according to the
    source (navigate to manage database connections) else you will get a message saying whether to replace the source database connection with one of the
    existed database connections in target.
    --Ram                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read ecel sheet and insert into oracle table

    hi all,
    am working on forms builder 6i. and i want , from a trigger to read from a a sheet excel file the data and insert into a table that i had aleady created.
    i whrite a code that can till now open the excel file but i cant read the data to insert it into the table.
    am using TEXT_IO.IS_OPEN to open the file
    TEXT_IO.GET_LINE to take each line
    and subst(x as variable) to read the first line , but the subsrt return nohing
    any solution??

    There's already a topic made on this: how to copy data from excel to oracle forms

  • Reg: read excel column and insert into table.

    hi Friends,
          i wanted to read the data from Excel and insert into in my oracle tables.
          can you provide the link or example script.
        how to read the column value from excel and insert into table.
      please help.

    < unnecessary reference to personal blog removed by moderator >
    Here are the steps:
    1) First create a directory and grant read , write , execute to the user from where you want to access the flat files and load it.
    2) Write a generic function to load PIPE delimited flat files:
    CREATE OR REPLACE FUNCTION TABLE_LOAD ( p_table in varchar2,
    p_dir in varchar2 DEFAULT ‘YOUR_DIRECTORY_NAME’,
    P_FILENAME in varchar2,
    p_ignore_headerlines IN INTEGER DEFAULT 1,
    p_delimiter in varchar2 default ‘|’,
    p_optional_enclosed in varchar2 default ‘”‘ )
    return number
    is
    – FUNCTION TABLE_LOAD
    – PURPOSE: Load the flat files i.e. only text files to Oracle
    – tables.
    – This is a generic function which can be used for
    – importing any text flat files to oracle database.
    – PARAMETERS:
    – P_TABLE
    – Pass name of the table for which import has to be done.
    – P_DIR
    – Name of the directory where the file is been placed.
    – Note: The grant has to be given for the user to the directory
    – before executing the function
    – P_FILENAME
    – The name of the flat file(a text file)
    – P_IGNORE_HEADERLINES
    – By default we are passing 1 to skip the first line of the file
    – which are headers on the Flat files.
    – P_DELIMITER
    – Dafault “|” pipe is been passed.
    – P_OPTIONAL_ENCLOSED
    – Optionally enclosed by ‘ ” ‘ are been ignored.
    – AUTHOR:
    – Slobaray
    l_input utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_lastLine varchar2(4000);
    l_cnames varchar2(4000);
    l_bindvars varchar2(4000);
    l_status integer;
    l_cnt number default 0;
    l_rowCount number default 0;
    l_sep char(1) default NULL;
    L_ERRMSG varchar2(4000);
    V_EOF BOOLEAN := false;
    begin
    l_cnt := 1;
    for TAB_COLUMNS in (
    select column_name, data_type from user_tab_columns where table_name=p_table order by column_id
    ) loop
    l_cnames := l_cnames || tab_columns.column_name || ‘,’;
    l_bindvars := l_bindvars || case when tab_columns.data_type in (‘DATE’, ‘TIMESTAMP(6)’) then ‘to_date(:b’ || l_cnt || ‘,”YYYY-MM-DD HH24:MI:SS”),’ else ‘:b’|| l_cnt || ‘,’ end;
    l_cnt := l_cnt + 1;
    end loop;
    l_cnames := rtrim(l_cnames,’,');
    L_BINDVARS := RTRIM(L_BINDVARS,’,');
    L_INPUT := UTL_FILE.FOPEN( P_DIR, P_FILENAME, ‘r’ );
    IF p_ignore_headerlines > 0
    THEN
    BEGIN
    FOR i IN 1 .. p_ignore_headerlines
    LOOP
    UTL_FILE.get_line(l_input, l_lastLine);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_eof := TRUE;
    end;
    END IF;
    if not v_eof then
    dbms_sql.parse( l_theCursor, ‘insert into ‘ || p_table || ‘(‘ || l_cnames || ‘) values (‘ || l_bindvars || ‘)’, dbms_sql.native );
    loop
    begin
    utl_file.get_line( l_input, l_lastLine );
    exception
    when NO_DATA_FOUND then
    exit;
    end;
    if length(l_lastLine) > 0 then
    for i in 1 .. l_cnt-1
    LOOP
    dbms_sql.bind_variable( l_theCursor, ‘:b’||i,
    ltrim(rtrim(rtrim(
    regexp_substr(l_lastLine,’([^|]*)(\||$)’,1,i),p_delimiter),p_optional_enclosed),p_optional_enclosed));
    end loop;
    begin
    l_status := dbms_sql.execute(l_theCursor);
    l_rowCount := l_rowCount + 1;
    exception
    when OTHERS then
    L_ERRMSG := SQLERRM;
    insert into BADLOG ( TABLE_NAME, ERRM, data, ERROR_DATE )
    values ( P_TABLE,l_errmsg, l_lastLine ,systimestamp );
    end;
    end if;
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_input );
    commit;
    end if;
    insert into IMPORT_HIST (FILENAME,TABLE_NAME,NUM_OF_REC,IMPORT_DATE)
    values ( P_FILENAME, P_TABLE,l_rowCount,sysdate );
    UTL_FILE.FRENAME(
    P_DIR,
    P_FILENAME,
    P_DIR,
    REPLACE(P_FILENAME,
    ‘.txt’,
    ‘_’ || TO_CHAR(SYSDATE, ‘DD_MON_RRRR_HH24_MI_SS_AM’) || ‘.txt’
    commit;
    RETURN L_ROWCOUNT;
    end TABLE_LOAD;
    Note: when you run the function then it will also modify the source flat file with timestamp , so that we can have the track like which file was loaded .
    3) Check if the user is having UTL_FILE privileges or not :
    SQL> SELECT OWNER,
    OBJECT_TYPE
    FROM ALL_OBJECTS
    WHERE OBJECT_NAME = ‘UTL_FILE’
    AND OWNER =<>;
    If the user is not having the privileges then grant “UTL_FILE” to user from SYS user:
    SQL> GRANT EXECUTE ON UTL_FILE TO <>;
    4) In the function I have used two tables like:
    import_hist table and badlog table to track the history of the load and another to check the bad log if it occurs while doing the load .
    Under the same user create an error log table to log the error out records while doing the import:
    SQL> CREATE TABLE badlog
    errm VARCHAR2(4000),
    data VARCHAR2(4000) ,
    error_date TIMESTAMP
    Under the same user create Load history table to log the details of the file and tables that are imported with a track of records loaded:
    SQL> create table IMPORT_HIST
    FILENAME varchar2(200),
    TABLE_NAME varchar2(200),
    NUM_OF_REC number,
    IMPORT_DATE DATE
    5) Finally run the PLSQL block and check if it is loading properly or not if not then check the badlog:
    Execute the PLSQL block to import the data from the USER:
    SQL> declare
    P_TABLE varchar2(200):=<>;
    P_DIR varchar2(200):=<>;
    P_FILENAME VARCHAR2(200):=<>;
    v_Return NUMBER;
    BEGIN
    v_Return := TABLE_LOAD(
    P_TABLE => P_TABLE,
    P_DIR => P_DIR,
    P_FILENAME => P_FILENAME,
    P_IGNORE_HEADERLINES => P_IGNORE_HEADERLINES,
    P_DELIMITER => P_DELIMITER,
    P_OPTIONAL_ENCLOSED => P_OPTIONAL_ENCLOSED
    DBMS_OUTPUT.PUT_LINE(‘v_Return = ‘ || v_Return);
    end;
    6) Once the PLSQL block is been executed then check for any error log table and also the target table if the records are been successfully imported or not.

  • Take permission for folder and contents

    Is there a way to take permissions for a whole folder and its contents all at once?
    I transfered hundereds of photos from my old MBP (Snow Leopord) to my new MBP (now Lion)
    I know how to change permission for a single file, but I'm tired of doing it one at a time....

    I get the following:
    chmod: Unable to change file mode on /Users/chris/Desktop/permissions/IMG_0298.JPG: Operation not permitted
    EDIT:
    I enabled root, and attempted it that way.
    I don't get the error message, but I also get no change on the files. The folder is now unlocked and I have permission for it, but I still have the files inside it locked.
    Any tips? Slight variation of the command?
    EDIT #2
    I also tried this command using path/filename on a individual picture, and it had no effect. Only unlocked the folders in my tests, not the files themselve. Perhaps I need a CLI for dummies guide
    Thanks,
    Chris

  • Is it possible to move download folder and contents to an external disk

    my download folder is very large.
    can i delete all downloads?
    can i move folder to an external drive for safe keeping?
    have tried to copy but this still leaves original files in download folder
    any help apprecietated.

    The Downloads folder is a "System Folder" and you shouldn't move it. Anything that you don't need in the Downloads folder you can delete.

  • Read local folder, return filenames into internal table

    Assume I have 3 files in c:\abc folder:
    a1.xls
    a2.xls
    a6.xls
    Is there a fm or code sample to pass in folder name (ie c:\abc) and returns a1.xls, a2.xls and a6.xls into internal table?

    Use Class CL_GUI_FRONTEND_SERVICES Method DIRECTORY_LIST_FILES to get list of file in a folder . FILE_TABLE will give the table with list of files
    data: begin of itab ,
            file(26) type c,
          end of itab.
    data: tab type table of itab.
    data : cnt type i.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
      EXPORTING
        DIRECTORY                   = 'C:\temp'
    *    FILTER                      = '*.*'
    *    FILES_ONLY                  =
    *    DIRECTORIES_ONLY            =
      CHANGING
        FILE_TABLE                  = tab
        COUNT                       = cnt
    *  EXCEPTIONS
    *    CNTL_ERROR                  = 1
    *    DIRECTORY_LIST_FILES_FAILED = 2
    *    WRONG_PARAMETER             = 3
    *    ERROR_NO_GUI                = 4
    *    NOT_SUPPORTED_BY_GUI        = 5
    *    others                      = 6
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Separating one iTunes account and content into two

    My partner and I are going through a divorce but we have shared the same iTunes account for the past 12 years. How do we separate our music library into two separate accounts so we can each have a portion of the library?

    Any music purchased after about 2009 can be played on any computer with the file on it.  That's the easy part.  Oh, I don't know if syncing present problems but I'm guessing it won't since people often have multiple Store accounts and shared music on family computers.
    Movies require the computer be authorized to the account used to purchase the content.  This is where you will have to come to an agreement not to change the password or de-authorize each other's computers for that account (there could be a scenario where this is done unintenionally but it shouldn't normally arise unless you have lots and lots of computers).
    One  tip is to make sure you always have all content present on a local drive.  Do not put yourself in a position to ever need to re-download media from the Store.  I am presuming you will have your own account after this and the main problem people seem to have with using multiple Store accounts on a computer is being prevented from changing accconts more than once every 90 days for the purpose of re-downloading.  Otherwise families often have multiple AppleID users on a single computer with shared media.
    You may have to ease up on doing anything such as using iTunes Match or iCloud downloads with this particular account, but we're talking trying to rescue what you can.

  • How to read XML file and write into another XML file

    Hi all, I am new to JAVAXML.
    My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
    I solved, how to read XML file
    But I don't know how to Write nodes into another XML.
    Can anyone help in this???
    Thanks in advance..

    This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
    Dave Patterson

  • How to Read Xml File and view into Data Grid View?

    hi all
    my Data into Xml file are:
    <Voucher>
    <Header>
    <txtHeaderId>259803</txtHeaderId>
    <txtDate>2015/02/01</txtDate>
    <txtDocNo>20</txtDocNo>
    <txtMemo>This is a Test .</txtMemo>
    </Header>
    <Item>
    <txtItemId>8562803</txtItemId>
    <txtHeaderRef>259803</txtHeaderRef>
    <txtDesc>This is Number 1</txtDesc>
    <txtDebit>350000</txtDebit>
    <txtCredit>0</txtCredit>
    <txtItemId>8562804</txtItemId>
    <txtHeaderRef>259803</txtHeaderRef>
    <txtDesc>This is Number 2</txtDesc>
    <txtDebit>0</txtDebit>
    <txtCredit>350000</txtCredit>
    </Item>
    </Voucher>
    now i have two DataGridViews 
    i want that data from xml file show into the DataGridViews by this codes:
    Private Sub btnReadXmlFile_Click(sender As Object, e As EventArgs) Handles btnReadXmlFile.Click
    Dim Document As XmlReader = New XmlTextReader(txtPath.Text)
    Dim ds As New DataSet
    ds.ReadXml(Document)
    DataGridView1.DataSource = ds.Tables(0)
    End Sub
    but i see this result:
    why i do not see any result into DataGridView2(Item)
    how to solve it ?
    please help me .
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    now how to correct it?
    Name of Allah, Most Gracious, Most Merciful and He created the human
    Please be explicit - I'm the only other one in this thread so I assume it's to me, but usually I just ignore the posts when the user isn't specific.
    I don't know what there is to correct. Create a NEW dataset in code, add the two tables, and use the methods that I suggested.
    I'm not a database guy so I can't get real specific. I create my own stuff in classes and use that but, if you're using SQL then there are lots of pro's here that can help you with specifics. I'm sure they'll need to know a lot more about your data, the
    connection, and all that, but the concept should be fairly simple to implement.
    Still lost in code, just at a little higher level.

Maybe you are looking for

  • Deployment hangs

    Hi, I am trying to deploy a configuration, Business Protocol is Custom Doc over Internet (AS2). I have only specified one trading agreement (there are no other agreements deployed or specified) for the config I am trying to deploy. When stopping all

  • NullpointerException while returning XML bean from JDBC Control

    Hi, I have a simple jdbc control method which returns multiple rows of a table. i am trying to get the data in XML bean format and followed the instruction provided in the help documentation. None of the columns in table has null values. The exceptio

  • Integration Repository Interfaces - Documentation??

    I'm looking for an on-line source for the integration respository interfaces - similar to the now deprecated Interface Repository (IFR)(http://ifr.sap.com). In particular, I'm looking for the WSDL/XML and Java Proxy interfaces for the following BAPIs

  • My disk drive in my macbook won't work

    when i try to insert a disk into my disk drive in macbook pro nothing happens there is no noise it just won't take it. i was wondering if anyone would know how much will it cost to get it fixed or get a new one installed? kind regards

  • Help with HTMLSelectOneMenu

    I am a new developer with JSF and facing following problem with HTMLSelectOneMenu ..... i have a HTMLSelectOneMenu on a page and wants to populate it when ever the page is rendered. I do get the data from database in a bean before page is rendered bu