Hello , how could i insert some content into a large file?

hello , how could i insert some content in a large file? ----just like a txt editor do.
assume that i have a 6G file(i think it large enough), then i wann insert one ascii character at the begining of the file,does that means:
1> i need create one 6G+1byte new file, then copy all content of the original file following by that addition character?
2> not creat new file,just set original file length to 6G+1byte,then offset all 6G byte by one byte,after all adding my one character?(it seems not some kind of optimization ...)
what should i do?
Edited by: littleJohnny on Jan 16, 2008 2:03 AM

could some means can set the read hint of 6Gbyte content after my character first read out? ----just let my addition point to the begining of 6G original content ,then the addition character take the place of the file header? ----the inster may be the same....
i just think the already used txt editor seem so fast to process insert, replace .... 2M 10M maybe.... does they doing those operation use Java Type ---String? ------read all contet into memory,then it is easy to regular expression ,relinking read order....-----does it mean large file couldn't against with pattern?
does all ctrl+s shortcut-----rewrite original file with memory relinked order? then large file could not easily manipulate its structure but all structured file is large than plain format...
just teach me some "already used txt editor " trick,thanks very much.

Similar Messages

  • How to write the JTables Content into the CSV File.

    Hi Friends
    I managed to write the Database records into the CSV Files. Now i would like to add the JTables contend into the CSV Files.
    I just add the Code which Used to write the Database records into the CSV Files.
    void exportApi()throws Exception
              try
                   PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
                   System.out.println("Connected");
                   stexport=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                   rsexport=stexport.executeQuery("Select * from IssuedBook ");
                   ResultSetMetaData md = rsexport.getMetaData();
                   int columns = md.getColumnCount();
                   String fieldNames[]={"No","Name","Author","Date","Id","Issued","Return"};
                   //write fields names
                   String rec = "";
                   for (int i=0; i < fieldNames.length; i++)
                        rec +='\"'+fieldNames[i]+'\"';
                        rec+=",";
                   if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                   writing.println(rec);
                   //write values from result set to file
                    rsexport.beforeFirst();
                   while(rsexport.next())
                        rec = "";
                         for (int i=1; i < (columns+1); i++)
                             try
                                    rec +="\""+rsexport.getString(i)+"\",";
                                    rec +="\""+rsexport.getInt(i)+"\",";
                             catch(SQLException sqle)
                                  // I would add this System.out.println("Exception in retrieval in for loop:\n"+sqle);
                         if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                        writing.println(rec);
                   writing.close();
         }With this Same code how to Write the JTable content into the CSV Files.
    Please tell me how to implement this.
    Thank you for your Service
    Jofin

    Hi Friends
    I just modified my code and tried according to your suggestion. But here it does not print the records inside CSV File. But when i use ResultSet it prints the Records inside the CSV. Now i want to Display only the JTable content.
    I am posting my code here. Please run this code and find the Report.csv file in your current Directory. and please help me to come out of this Problem.
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    public class Exporting extends JDialog implements ActionListener
         private JRadioButton rby,rbn,rbr,rbnore,rbnorest;
         private ButtonGroup bg;
         private JPanel exportpanel;
         private JButton btnExpots;
         FileReader reading=null;
         FileWriter writing=null;
         JTable table;
         JScrollPane scroll;
         public Exporting()throws Exception
              setSize(550,450);
              setTitle("Export Results");
              this.setLocation(100,100);
              String Heading[]={"BOOK ID","NAME","AUTHOR","PRICE"};
              String records[][]={{"B0201","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0202","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0203","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0204","PRIAM","SELVI","1354"},
                               {"B0205","JAVA PROGRAMING","JAMES","1234.00"},
                               {"B0206","SERVLET PROGRAMING","GOSLIN","1425.00"},
                               {"B0207","PHP DEVELOPMENT","SUNITHA","123"},
                               {"B0208","PRIAM","SELVI","1354"}};
              btnExpots= new JButton("Export");
              btnExpots.addActionListener(this);
              btnExpots.setBounds(140,200,60,25);
              table = new JTable();
              scroll=new JScrollPane(table);
              ((DefaultTableModel)table.getModel()).setDataVector(records,Heading);
              System.out.println(table.getModel());
              exportpanel= new JPanel();
              exportpanel.add(btnExpots,BorderLayout.SOUTH);
              exportpanel.add(scroll);
              getContentPane().add(exportpanel);
              setVisible(true);
          public void actionPerformed(ActionEvent ae)
              Object obj=ae.getSource();
              try {
              PrintWriter writing= new PrintWriter(new FileWriter("Report.csv"));
              if(obj==btnExpots)
                   for(int row=0;row<table.getRowCount();++row)
                             for(int col=0;col<table.getColumnCount();++col)
                                  Object ob=table.getValueAt(row,col);
                                  //exportApi(ob);
                                  System.out.println(ob);
                                  System.out.println("Connected");
                                  String fieldNames[]={"BOOK ID","NAME","AUTHOR","PRICE"};
                                  String rec = "";
                                  for (int i=0; i <fieldNames.length; i++)
                                       rec +='\"'+fieldNames[i]+'\"';
                                       rec+=",";
                                  if (rec.endsWith(",")) rec=rec.substring(0, (rec.length()-1));
                                  writing.println(rec);
                                  //write values from result set to file
                                   rec +="\""+ob+"\",";     
                                   if (rec.endsWith(",")) rec=rec.substring(0,(rec.length()-1));
                                   writing.println(rec);
                                   writing.close();
         catch(Exception ex)
              ex.printStackTrace();
         public static void main(String arg[]) throws Exception
              Exporting ex= new Exporting();
    }Could anyone Please modify my code and help me out.
    Thank you for your service
    Cheers
    Jofin

  • How can I insert an image into an mov file in iMovie while keeping the background music?

    I have a short MOV file movie clip that has background music but one of the images (it's a static element with text) is incorrect. How can I replace the image but keep the backgroup the same? Also what size would the image need to be to properly fit?
    Thank you!

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • How do I insert a page into multiple .PDF files?

    Hi everyone, I have several hundred PDF files every month, and I need to insert a page at the end of each document.
    The files and insert are in PDF format. What is the easiest way to do this?
    I am using Acrocrbat 10.
    Thank You

    If you have Acrobat X Pro, and the PDFs aren't secured, it's easy to do it with an Action.
    File > Action Wizard > Create New Action
    Set "Start with" to "Ask" so you can choose a folder each month
    From the panels on the left, choose Pages > Insert Pages
    Click the Options icon, choose the file containing the page you want to insert, then set it to After / Last Page
    Set the Save To options to suit what you want.
    Now you can run the Action against an entire folder of PDFs.

  • How could i activate BI-Content for SPP

    Hello
    How could i activate BI-Content for SPP.
    I only find the reoport RSBCT_BICONTENT_ACTIVATE. But it does not work for SPP
    I geht the following message:
    Finished starting the activation. Please check the application log with external ID BI Content Installer (SCM)
    But in the sm 37 i don't find anything.
    Thanks
    Sven

    Hi MadissonStudios.
    Thanks for the time you took to try and help me out.
    I can't access the link (even correcting the double '//' or the space in the link.
    I've followed your sugesttion and tested it but didn't work. The hover state is always for the top layer (z order) and the hover state of the image fills over the text. If I put the text over, it covers the image. Grouping didn't make a difference.
    Maybe I'm getting your indications wrong, but without access to the file, I don't see another way I could have done it any different.
    Thanks once more.

  • How do I insert additional clips into my video timeline in Elements 13?  When clicking 'add media' it added the clips at end of video rather than in their appropriate position.  Could not 'cut and paste'.

    How do I insert additional clips into my video timeline in Elements 13?  When clicking 'add media' it added the clips at end of video rather than in their appropriate position.  Could not 'cut and paste'.

    bhsleadership
    I am in the process of preparing to test a sample from your brand and model camera in my Premiere Elements 8.0/8.0.1 on Windows 7 64 bit. I will have the results probably tomorrow morning.
    For now I just want to put you through the drill that I do for anyone who says he/she is using Premiere Elements 8.0/8.0.1.
    1. Are you working from the 8.0/8.0.1 Update of the program?
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=4653
    2. Do you have the automatic Background Rendering and AutoAnalyzer features turned OFF.
    For Background Rendering option. See Edit Menu/Preferences/General.
    For AutoAnalyzer option. Click on Organizer in the row below the blue active Organize header in order to open the Elements Organizer. In the Elements Organizer workspace, go to Edit Menu/Preferences/AutoAnalyzer Options and disable all the AutoAnalzyer options. To return to the Premiere Elements workspace from the Elements Organizer workspace, in the Elements Organizer workspace, go to File Menu/Exit.
    Is your computer optimized in spite of the fact that  you have a high end laptop? I presumed so but always go to verify, no pile ups of preview files, conformed video and audio files et al.
    Looking at the properties of your source media, I see:
    video compression = MPEG1
    audio compression = MPEG-Layer1 (.mp2)
    Frame Size = 640 x 480 (4:3)
    Pixel Aspect Ratio = 1.0
    Frame Rate = 30 progressive frames per second
    With properties like those you are sure to get a red line over that content since there is no project preset with that description.
    But, your choice of the default NTSC DV Standard would have been mine also.
    I am heading to try to get a quick look at the behavior of the sample video here in my Premiere Elements 8.0/8.0.1.
    To be continued.
    ATR

  • I could not inset DVD into my Macbook pro CD-Driver. How could I insert it/

    I could not inset DVD into my Macbook pro CD-Driver. How could I insert it/

    try ejecting the drive incase there is something inside. if you are trying to say that the drive won't read DVDs that are inserted then you have a slightly larger problem. also if you do not hear a noise of some sort after seeing the eject symbol on the screen your optical drive may be broken or unresponsive in either case make an appointment with the apple store

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • What is the efficient way of insert some bytes into a file?

    Hello, everyone:
    If I want to insert some bytes into a file (for example, insert the bytes before all the original content of the file, or append the bytes to a file), and the size of the original file is very big. I am wondering what is the efficient way? Where can I get some sample codes?
    regards,
    George

    Thanks, DrClap.
    I have tried your method and you are correct. I have written a simple program which can be used to insert "Hello World " to the start of a file ("c:\\temp\\input.txt"), and I have verified that it can work. Please help to see whether it is correct and whether it has a more efficient way.
    public class TestDriver {
         public static void main(String[] args) {
              byte[] back_buffer = new byte [1024];
              byte[] write_buffer = new byte [1024];
              System.arraycopy("Hello World".getBytes(), 0, write_buffer, 0, "Hello World".getBytes().length);
              int write_buffer_length = "Hello World ".getBytes().length;
              int count = 0;
              FileInputStream fis = null;
              FileOutputStream fos = null;          
              try {
                   fis = new FileInputStream (new File("c:\\temp\\input.txt"));
                   fos = new FileOutputStream (new File("c:\\temp\\output.txt"));
                   while ((count = fis.read (back_buffer)) >= 0)
                        fos.write(write_buffer, 0, write_buffer_length);
                        System.arraycopy (back_buffer, 0, write_buffer, 0, count);
                        write_buffer_length = count;
                   //write the last block
                   fos.write(write_buffer, 0, write_buffer_length);
                   fis.close();
                   fos.close();
                   //copy content back into original file
                   fis = new FileInputStream (new File("c:\\temp\\output.txt"));
                   fos = new FileOutputStream (new File("c:\\temp\\input.txt"));
                   while ((count = fis.read (back_buffer)) >= 0)
                        fos.write(back_buffer, 0, count);
                   fis.close();
                   fos.close();
                   //remove temporary file
                   File f = new File ("c:\\temp\\output.txt");
                   f.delete();
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   try {
                        fis.close();
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   try {
                        fos.close();
                   } catch (IOException e2) {
                        // TODO Auto-generated catch block
                        e2.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   try {
                        fis.close();
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   try {
                        fos.close();
                   } catch (IOException e2) {
                        // TODO Auto-generated catch block
                        e2.printStackTrace();
    }regards,
    George

  • Are Virtual Copies saved in Backups? How do I insert a backup into an existing catalog?

    Are Virtual Copies saved in Backups? How do I insert a backup into an existing catalog
    I deleted a tif image file that I didn't intend to, which had several LR virtual copies created from it. The virtual copies had a lot of important history that document my print preparation edits. Are these virtual copies saved in the LR backups?
    If so, how can I insert them into the catalog I am using? I have made a lot of edits in the two days since my last backup and don't want to lose that history either. Do you suggest I make a current backup before retrieving files from my last backup? I know I'm supposed to go to the backup location and open the last backup, but how do I blend that with the current work from the last 2 days?
    Any help would be most appreciated. Thanks, Tom

    Rob,
    That was exactly what I was after. However, I'm still having trouble getting the virtual copies imported. The master file was in my trash, I restored it to the original hard drive folder. Before I got your message I re- imported it to LR but of course LR came up with a new name since I was importing from and saving it to the same folder in LR. And of course no copies. This may have been a mistake, but before starting the procedure you described, I re-named the master file (it seemed that the import from backup would re-create it so I didn't want  a conflict).
    Then I did what you said and used the 'Import From Another Catalog' feature. I found the virtual copies in the backup and checked them. But when the import completed, the it gave me file names  xxx/Copy1, xxx/Copy2 but there was no image or history or metadata. When I tried to find the folder containing the files, it said it couldn't be found. So I missed something in the settings. When I tried again, there was a warning saying the file(s) exists in the catalog and its settings differ. I went ahead anyway and the message I got was "No Photos in previous import"
    Here's what the import from backup shows:
    A box with catalog contents and all the folders and files within them, that you can check.
    A New Photos section, which gives 2 file handling choices: a)add new photos to the catalog without moving them or b) don't import new photos
    A Changed existing photos section with 2 replace options: a) nothing or b) Metadata and develop setting only. If you choose this you can check a box to preserve old settings as a virtual copy.
    Not sure what to do. I changed the master file back to its original name, but that didn't make a difference. Suggestions? Thanks, Tom

  • Inserting XML content into Database

    Hallo
    i´m new to Oracle.
    i want to insert xml content into the database. for testing i installed the version 10g on a windowsxp computer.
    i read the oracle xmldb developer´s guide. on page 3-4 ff. it is explained how i can insert content into the database. that´s how i did it (with isqlplus):
    create table example1(key_column varchar2(10) primary key, xml_column xmltype)
    -->works fine
    create table example2 of xmltype
    -->works fine
    now i made a directory under c:\myXmlFilesForDb in WinXp
    create directory xmldir as 'c:/myXmlFilesForDb in WinXp'
    (also tried: create directory xmldir as 'c:\myXmlFilesForDb in WinXp')
    --> in this directory is a file named: mydokument.xml
    --> works fine
    insert into example2 values(xmltype(bfilename('xmldir','mydokument.xml'), nls_charset_id('AL32UTF8')))
    the following error message is displayed (in German):
    ORA-22285: Verzeichnis oder Datei für FILEOPEN-Vorgang nicht vorhanden
    ORA-06512: in "SYS.DBMS_LOB",Zeile 523
    ORA-06512: in "SYS:XMLTYPE",Zeile 287
    ORA-06512: in Zeile 1
    whats wrong? can anybody help me please?
    ohhh....
    thank you very much
    cu
    George

    Directory entries are case sensitive.
    Select * From dba_directories to ensure you case is the same as you are using in your insert statement.
    Are you using the same user? if not grant read on directory directoryname to username;
    try to just select.
    select dbms_lob.getLength(BFileName('directoryname','filename.xml'))
    as length
    from dual;

  • Inserting HTML content into an animated DIV

    Can you, and if so how, insert HTLM content into an EGDE animated Div box? Specificaly an HTML table?  I can get the html code in the box but it won't read/render it as html code. In flash you can tell the program that the contents of the box is html code and it will read it as such but I don't see any way to do that here. I've tried several ways and I can get the code to display in the box but it won't render the code instruction in the boxCan it be done ??
    Thanks
    joel

    Hi,
    1) Your json file is not valid.
    You can copy and paste your datas here: http://jsonlint.com/
    Red commas must be deleted.
          "player": [
                "image": "images/player1.jpg",  //this is the URL I want to retrive
               "name": "player1",
                "image": "images/player2.jpg",
                "name": "player2", 
                "image": "images/player3.jpg",
                "name": "player3", 
                "image": "images/player4.jpg",
                "name": "player4",
    2)An example from http://docs.jquery.com/Ajax/jQuery.getJSON:
    3) compositionReady Tests.
    On compositionReady, i write:
    var profiles = {
                   "player": [
                        "image": "images/player1.jpg",
                        "name": "player1",
                         "image": "images/player2.jpg",
                         "name": "player2", 
                         "image": "images/player3.jpg",
                         "name": "player3", 
                         "image": "images/player4.jpg",
                         "name": "player4",
    console.log(profiles.player[1].image); // this line returns: "images/player2.jpg"
    Note: i deleted the first "[" and the last "]".

  • How do you insert a picture into another picture?

    How do you insert a picture into another picture.  For example, one person is missing from family photo & I'd like to insert that person's face.

    By using an external editor:
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate. You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    Help - How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    https://discussions.apple.com/thread/3383532?tstart=0
    Stefan

  • How do I insert a picture into iMovie regardless of aspect ratio

    When I insert a picture, i either have the choice of cropping the picture or having black bars on the sides. How can I insert a picture into imovie and not be dictated based on the aspect ratio. thanks

    Klaus1 wrote:
    Must be one of the wonderful improvements introduced in iMovie 11.
    nope, never.
    look:
    example #1: a 1:1 pic in a 16:9 screen
    option A bars l/r
    option B cat-off
    example #2: a wiiiide screen pic in a 16:9 screen
    option A bars t/b
    option B catcut off
    and you don't want kitty look like that:
    (1:1 aspect ratio distorted to make fit onto a 16:9 screen)

Maybe you are looking for

  • Error switching to PDF Layout Tab in txn SFP

    For any ADOBE PDF form, if I switch to the layout tab I get the following errors > Error while generating document > Memory Protection Fault in OLE Container Control I'm running SAPGUI 6.4 The SAP Server is WAS 6.4 I have Acrobat Reader 7.0.2 loaded

  • Install Sql Server2008 R2 on windows Server 2008 R2 standerd

    Hi everyone, I am new to share Point,   I install SharePoint 2010 successfully but i am not configure Sql Server2008 R2 ..   how to install Sql Server2008 R2 on sharepoint 2010 now.. THanks, srikanth.

  • How can I play Reverse between label A and label B

    hi again~ I have a symbol,some timaline and labels in it. so now I want to play reverse between the Label A and Lable B but the action syntax is like test1_play.playReverse(); so how can I play reverse rom LableB to LableA? I found this information,

  • Which EAP Type to choose for 802.1x Wireless Policy?

    Hi everyone, i have a question about recommendation for EAP Type in a wireless policy: Which configuration is more secure/recommendet? a) Authentication Type: PEAP EAP Type: EAP-MSCHAP v2 b) Authentication Type: EAP EAP Type: Certificate We have a wo

  • Anyone know anything about voulme settings?

    Whenever I put the volume all the way down on my ipod Nano, it automatically goes all the way back up to full volume. Everything else works fine on the scroller, it's just the volume. Anyone know how I can fix this?