SImple Text I/O Program

Morning,
I have gotten a new assignment which requires me to right a Text I/O program and to copy it as well. We are required to copy it using Command Line parameters I believe. Replacing the string of the text file created and copying it to a new file. So far I have the class written to write and read the file but the copying of the file does not seem to work.
Here is the code so far: import java.io.*;
import java.util.*;
public class WriteFile {
     public static void main (String []args)throws Exception {
          File text = new File("text.txt");
          if (text.exists()) {
               System.out.println("File already exists " + text.exists());
               System.exit(0);
          String [] array = {
               "Josh Harper ",
               "CS Student ",
               "January 22 1986 "
          PrintWriter output = new PrintWriter(text);
          for (int i= 0; i<3; i++) {
          output.println(array);
          output.close();
import java.io.*;
import java.util.*;
public class ReadFile {
     public static void main(String[] args) throws Exception {
          File text = new File("text.txt");
          Scanner input = new Scanner(text);
          while(input.hasNext()) {
               String fname = input.next();
               String lname = input.next();
               String degree = input.next();
               String student = input.next();
               String month = input.next();
               int date = input.nextInt();
               int year = input.nextInt();
               System.out.println(fname + " " + lname + "\n" + degree + " " + student + "\n" + month + " " + date + " " + year);
          input.close();
import java.io.*;
import java.util.*;
public class CopyText {
     public static void main (String[] args) throws Exception {
          if (args.length != 4) {
               System.out.println("Usage:java CopyText.java text.txt copy.txt PrintWriter PrintWriter");
               System.exit(0);
          File sourcefile = new File(args[0]);
          if (!sourcefile.exists()) {
               System.out.println("Source file " + args[0] + " does not exist");
               System.exit(0);
          File copyfile = new File(args[1]);
          if (copyfile.exists()) {
               System.out.println("The copy file " + args[1] + " already exists");
               System.exit(0);
          Scanner input = new Scanner(sourcefile);
          PrintWriter output = new PrintWriter(copyfile);
          while(input.hasNext()) {
               String s1 = input.nextLine();
               String s2 = s1.replaceAll(args[2], args[3]);
               output.println(s2);
          input.close();
          output.close();
Any insight on how the code for copying text by passing through as a command-line argument will be much of a great help, the book we use is very vague and the professor explanation was hard to replicate while doing my own program
Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Hello,
I'm not exactly sure of what your problem but if you just want to copy files, whether they are plain text or other, you can just use the good old method which copy byte by byte your file
public static void copyFile(File in, File out) throws Exception {
    FileInputStream fis  = new FileInputStream(in);
    FileOutputStream fos = new FileOutputStream(out);
    try {
        byte[] buf = new byte[1024];
        int i = fis.read(buf);
        while (i  != -1) {
            fos.write(buf, 0, i);
            i = fis.read(buf);
    catch (Exception e) {
        throw e;
    finally {
        if (fis != null) fis.close();
        if (fos != null) fos.close();
  }You can also, if you want to go deeper, check at the java API for java.nio.channels for faster copy but I'm not a huge fan of it.

Similar Messages

  • Simple text plain talk program - filterhappier - radiohead

    i was wondering if anyone knew if there was an online program where i could type in text and have the retro robotic voice read it out like on the old macs. i have a computer thus using windows so i doubt i can download the program though apple however if anyone knows of a website that will allow me to do this i would appreciate it. if you dont know what im talkign about, a similar program is used in the song filter happier by radiohead

    As far as I know it is still on the NEW macs. As for a PC app, I don't know. Probably. Do a google search for speech from text and see what comes up. Or you could just buy an old used Mac I see old G3s going for $100 or less here and there.

  • Cannot print a simple Text File

    Hello All,
    I wrote the following program
    import java.io.*;
    import java.awt.print.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    public class TestPrint
         public static void main(String[] args) throws Exception
              FileInputStream fis = new FileInputStream(new File("pds.txt"));
              byte[] fileByte = new byte[34];
              int read = 0;
              int counter = 0;
              while((read = fis.read()) != -1)
                   fileByte[counter++] = (byte)read;
              PrintService services[] = PrinterJob.lookupPrintServices();
              DocFlavor flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
              PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
              aset.add(MediaSizeName.ISO_A4);
              aset.add(new Copies(1));
              Doc doc = new SimpleDoc(fileByte, flavor, null);
              DocPrintJob pj = services[0].createPrintJob();
              pj.print(doc, aset);
    }The file I am trying to print is a simple text file. My requirement is to convert it to an array of bytes and then print it.
    However I get the exception
    Exception in thread "main" java.lang.IllegalArgumentException: data is not of de
    clared type
    at javax.print.SimpleDoc.<init>(Unknown Source)
    at TestPrint.main(TestPrint.java:25)
    Please help me. I would appriciate any help in this matter.
    regards,
    Abhishek.
    PS: The contents of the file (pds.txt) which I am trying to print is
    PDS
    pds
    pds
    pds
    pds

    Hi,
    you get a java.lang.IllegalArgumentException in line 25:
    So we take the Java API for SimpleDoc:
    IllegalArgumentException - if flavor or printData is null, or the printData does not correspond to the specified doc flavor--for example, the data is not of the type specified as the representation in the DocFlavor.
    Since fileByte seems not the be null, the type must be wrong!
    In line 21 we see:
    DocFlavor flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
    so fileByte must be type java.io.InputStream, which it isn�t. This causes your IllegalArgumentException.
    So try in line 21:
    DocFlavor flavor = DocFlavor.BYTE_ARRAY.TEXT_PLAIN_US_ASCII;
    Let me know if that was the reason!
    Best regards
    Martin

  • FM with code to send a simple text mail to external ID

    Hi All,
    I need a FM with code if possible to send a simple text mail to an external e-mail id or distribution list. I tried using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 and was successfull in sending mail. But it requires attachment.
    I need help to send mail without attachment with code.
    All configurations done at my end.
    Thanks
    Anirban Bhattacharjee

    Hi Anirban,
    Please check this sample code.
    * Email ITAB structure
    DATA: BEGIN OF EMAIL_ITAB OCCURS 10.
            INCLUDE STRUCTURE SOLI.
    DATA: END OF EMAIL_ITAB.
    DATA: T_EMAIL LIKE SOOS1-RECEXTNAM.  "EMail distribution list
    CONSTANTS: C_EMAIL_DISTRIBUTION LIKE SOOS1-RECEXTNAM VALUE
               ‘[email protected],[email protected]’.
    * Initialization
    REFRESH EMAIL_ITAB.
    * Populate data
    EMAIL_ITAB-LINE = ‘Email body text 1’.
    APPEND EMAIL_ITAB.
    EMAIL_ITAB-LINE = ‘Email body text 2’.
    APPEND EMAIL_ITAB.
    T_EMAIL = C_EMAIL_DISTRIBUTION.
    * --- EMAIL FUNCTION ---------------------------------------------------
    * REQUIRMENTS:
    * 1) The user running the program needs a valid email address in their
    *    address portion of tx SU01 under external comms -> SMTP -> internet
    *    address.
    * 2) A job called SAP_EMAIL is running with the following parameters:
    *    Program: RSCONN01  Variant: INT   User: XXX
    *    This program moves mail from the outbox to the mail server using
    *    RFC destination: SAP_INTERNET_GATEWAY_SERVER
    * INTERFACE:
    * 1) APPLICATION: Anything
    * 2) EMAILTITLE:  EMail subject
    * 3) RECEXTNAM:   EMail distribution lists separated by commas
    * 4) TEXTTAB:     Internal table for lines of the email message
    * EXCEPTIONS:
    * Send OK = 0 otherwise there was a problem with the send.
        CALL FUNCTION 'Z_SEND_EMAIL_ITAB'
             EXPORTING
                  APPLICATION = 'EMAIL'
                  EMAILTITLE  = 'Email Subject'
                  RECEXTNAM   = T_EMAIL
             TABLES
                  TEXTTAB     = EMAIL_ITAB
             EXCEPTIONS
                  OTHERS      = 1.
    Function Z_SEND_EMAIL_ITAB
    *"*"Local interface:
    *"       IMPORTING
    *"             VALUE(APPLICATION) LIKE  SOOD1-OBJNAM
    *"             VALUE(EMAILTITLE) LIKE  SOOD1-OBJDES
    *"             VALUE(RECEXTNAM) LIKE  SOOS1-RECEXTNAM
    *"       TABLES
    *"              TEXTTAB STRUCTURE  SOLI
    *- local data declaration
      DATA: OHD    LIKE SOOD1,
            OID    LIKE SOODK,
            TO_ALL LIKE SONV-FLAG,
            OKEY   LIKE SWOTOBJID-OBJKEY.
      DATA: BEGIN OF RECEIVERS OCCURS 0.
              INCLUDE STRUCTURE SOOS1.
      DATA: END OF RECEIVERS.
    *- fill odh
      CLEAR OHD.
      OHD-OBJLA    = SY-LANGU.
      OHD-OBJNAM   = APPLICATION.
      OHD-OBJDES   = EMAILTITLE.
      OHD-OBJPRI   = 3.
      OHD-OBJSNS   = 'F'.
      OHD-OWNNAM   = SY-UNAME.
    *- send Email
      CONDENSE RECEXTNAM NO-GAPS.
      CHECK RECEXTNAM <> SPACE AND RECEXTNAM CS '@'.
    *- for every individual recipient send an Email
    * (see OSS message 0120050409/0000362105/1999)
      WHILE RECEXTNAM CS ','.
        PERFORM INIT_REC TABLES RECEIVERS.
        READ TABLE RECEIVERS INDEX 1.
        RECEIVERS-RECEXTNAM = RECEXTNAM+0(SY-FDPOS).
        ADD 1 TO SY-FDPOS.
        SHIFT RECEXTNAM LEFT BY SY-FDPOS PLACES.
        MODIFY RECEIVERS INDEX 1.
        PERFORM SO_OBJECT_SEND_REC
         TABLES TEXTTAB RECEIVERS
          USING OHD.
      ENDWHILE.
    *- check last recipient in recipient list
      IF RECEXTNAM <> SPACE.
        PERFORM INIT_REC TABLES RECEIVERS.
        READ TABLE RECEIVERS INDEX 1.
        RECEIVERS-RECEXTNAM = RECEXTNAM.
        MODIFY RECEIVERS INDEX 1.
        PERFORM SO_OBJECT_SEND_REC
         TABLES TEXTTAB RECEIVERS
          USING OHD.
      ENDIF.
    ENDFUNCTION.
    *       FORM SO_OBJECT_SEND_REC                                       *
    FORM  SO_OBJECT_SEND_REC
    TABLES  OBJCONT      STRUCTURE SOLI
            RECEIVERS    STRUCTURE SOOS1
    USING   OBJECT_HD    STRUCTURE SOOD1.
      DATA:   OID     LIKE SOODK,
              TO_ALL  LIKE SONV-FLAG,
              OKEY    LIKE SWOTOBJID-OBJKEY.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                EXTERN_ADDRESS             = 'X'
                OBJECT_HD_CHANGE           = OBJECT_HD
                OBJECT_TYPE                = 'RAW'
                OUTBOX_FLAG                = 'X'
                SENDER                     = SY-UNAME
           IMPORTING
                OBJECT_ID_NEW              = OID
                SENT_TO_ALL                = TO_ALL
                OFFICE_OBJECT_KEY          = OKEY
           TABLES
                OBJCONT                    = OBJCONT
                RECEIVERS                  = RECEIVERS
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                FOLDER_NOT_EXIST           = 4
                FOLDER_NO_AUTHORIZATION    = 5
                FORWARDER_NOT_EXIST        = 6
                NOTE_NOT_EXIST             = 7
                OBJECT_NOT_EXIST           = 8
                OBJECT_NOT_SENT            = 9
                OBJECT_NO_AUTHORIZATION    = 10
                OBJECT_TYPE_NOT_EXIST      = 11
                OPERATION_NO_AUTHORIZATION = 12
                OWNER_NOT_EXIST            = 13
                PARAMETER_ERROR            = 14
                SUBSTITUTE_NOT_ACTIVE      = 15
                SUBSTITUTE_NOT_DEFINED     = 16
                SYSTEM_FAILURE             = 17
                TOO_MUCH_RECEIVERS         = 18
                USER_NOT_EXIST             = 19
                X_ERROR                    = 20
                OTHERS                     = 21.
      IF SY-SUBRC <> 0.
        RAISE OTHERS.
      ENDIF.
    ENDFORM.
    *       FORM INIT_REC                                                 *
    FORM INIT_REC TABLES RECEIVERS STRUCTURE SOOS1.
      CLEAR RECEIVERS.
      REFRESH RECEIVERS.
      MOVE SY-DATUM  TO RECEIVERS-RCDAT .
      MOVE SY-UZEIT  TO RECEIVERS-RCTIM.
      MOVE '1'       TO RECEIVERS-SNDPRI.
      MOVE 'X'       TO RECEIVERS-SNDEX.
      MOVE 'U-'      TO RECEIVERS-RECNAM.
      MOVE 'U'       TO RECEIVERS-RECESC.
      MOVE 'INT'     TO RECEIVERS-SNDART.
      MOVE '5'       TO RECEIVERS-SORTCLASS.
      APPEND RECEIVERS.
    ENDFORM.
    Hope this will help.
    Regards,
    Ferry Lianto

  • Does OS Tiger have any built in text or typing programs?

    Does Tiger have any built in text or typing programs or do you have to buy iWork for Pages? Does it have anything simple like Wordpad in Windows built in? Thanks!
    Compaq Presario 700   Windows XP  

    And don't allow the very simple interface and plain/no frills appearance of Text Edit fool you since looks can be deceiving.
    It is much more capable than it appears.

  • I get this message when trying to past simple text into an e-mail document. The Web-Based Email plugin has crashed. I have run out of options...please help.

    The Web-Based Email plugin has crashed. I get this message when trying to paste simple text into an email document. I have updated plugins and have run out of options. If I use another browser I have no problem. Please advise.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • Everytime i try to add a text box the program crashes.  Why and how do I fix it?

    Since I purchased and installed Adobe Photoshop Elements every time I try to add a text box the program crashes.  Why and how do I fix it?

    TeeKnows wrote:
    Debit cards are accepted in the iTunes store.
    No longer accepted for NEW accounts, however if a debit card were associated with the account BEFORE this change, they can still be used.

  • Pixelated Text in Adobe Programs (MacBook Pro - Retina)

    I have a new laptop, a Macbook Pro with Retina Display (mid-2014). I already have a iMac and never experienced this issue before. The text in various programs like photoshop, illustrator & acrobat are pixelated.  It's not only the text in the menu/notification/warning windows (see photo for ref) but also the text within a vector based program like llIustrator (see photo for ref). Now I have not yet installed any other fonts on here - all are factory fonts so far. Not sure if that has anything to do with it. I am experienced with Macs (raster/pixelation vs. vector art) but not enough to know why I am having this issue. Thanks!

    Clinton- The problem is that the way things are setup is a bit confusing. Apple doesn't let us use the actual full resolution of 2880 x 1800, in relateive size. There is a hack to see the screen at full native resolution, and it's unbelievably small. So what they do is use the pixels, but use 4 vs 1, and thus they make the UI look like it would look as standard 1440 x 900 display. I have an old 15" and looking at both, the UI is the same relative size on the screen. However the retina is using more pixels to make the same physical size.
    Now, Apple also lets apps use 1:1 within their "working area." For instance, if you view a graphic on a web page, it shows it doubled, and pixelated. But if you drag that image to the desktop then open in Preview, preview will show it half size of Safari, but in actual resolution. it's sharp, but half the size of Safari, as Safari is doubling it. So apps can take advantage of that but will have to be updated. Pixelmator isn't updated, and graphics/text/vectors are blurry in their work area, but once you save/export, and view in preview, they are perfect.
    So there is going to be a lot of strange stuff going on until everyone gets on the same page.
    I did find you can view Pages/Numbers with better resolution (just not icons) by right-clicking "get info" and unchecking open in low resolution. But Pages acts weird. I will post a screenshot in a minute about what I mentioend about apps using the native resolution within work spaces.
    Bryan

  • I just did the photoshop camera raw update and now everytime I try to do a text box or change the text the whole program crashes.

    I just did the photoshop camera raw update and now every time I try to do a text box or change the text the whole program crashes.

    All fixed!!!  My Aperture wasn't being recognized because it was in a folder.  OK, now I can use my camera with Aperture. 

  • How can I get my text to speech program NVDA to work on Adobe Digital Edition 2.0?

    Adobe Digital Edition 2.0 text to speech program NVDA is suppose to work. How can I get it to work?

    In short, no. iAS is a 2.2 servlet container. You would have to backport your application to version 2.2 of the servlet spec.

  • How to transport text in report programs

    hi experts,
                   any one tell me how to transport "text" in report programs.
                                         thanking u ,

    Chk these threads:
    Transporting Translations of Text Elements in SE38
    How do I disable input for a table control?
    Hope this helps.
    Regards
    Vinayak

  • Adobe reader  X and XI search don´t find text like other programs including adobe reader 9? Thanks

    Adobe reader  X and XI search don´t find text like other programs including adobe reader 9? Thanks

    You mean, you are trying to search text in a PDF file, and you can do it in Reader 9 but not in later versions of Reader (using the same file)?

  • Efficient data structure to implement simple text editor?

    I was given this problem in an interview:
    What data structure would you use to implement a simple text editor that does these 4 functions:
    a) goto(line number)
    b) insert(char input,location)
    c) delete(location)
    d) printAll() //print entire file
    Given that i'm such a newb, i was stumped. I came up with making a 2d array that would allow for o(1) time for goto, but o(n) for everything else (shifting everything in the array). there were other downfalls too dealing with space issues and such, but he wanted me to optimize this data structure. I then came up with a linked list of arrays, but that had similar problems.
    But thinking about it further is driving me a little crazy so I'm wondering if you guys have any suggestions on how to answer this question...
    one thing that came to mind after is to implement the data structure as a binary tree, where each node contains
    class Node
    char theChar
    int position; // ie 0 = first character in the file, and 81 could be the first character in the 2nd line
    node left,right,parent;
    }so how it works is the cursor would know where the location was so i would know where to delete and insert within the tree.
    insert {
         //search for location to insert after (log n)
           //create new character node and append to current node
         //increment position for all subsequent children
    delete(x) {
         search for x position
         if found, remove node and decrement position value for all children
    goto(line #) {
         return line # * 80 (or whatever max length for a single line)
    }the major problem i see here is balancing the tree after every insert/delete
    Thanks in advance.

    One of many great things emacs has given us is the gap buffer:
    http://en.wikipedia.org/wiki/Gap_buffer
    To see a Java implementation of this you can look in the Java SDK source. The document model (I forget exactly what its called), used in Swing uses a gap buffer.

  • Sandy - a simple text editor

    sandy - a simple text editor
    Sandy is a X11 text editor with an easy-to-read, hackable C source. It uses GTK+ and GtkSourceView for convenience and is akin to surf, only it is a text editor, not a web browser. Sandy tries to maximize screen estate, minimize the SLOC used and not get in your way too much. It can somehow be controlled via XProperties and all preferences and keybindings are to be chosen at compile time. Two example configs are provided with the source.
    Features
    - Basic editing, saving, etc.
    - One document per instance
    - Embeddable (e.g. can use http://tools.suckless.org/tabbed for tabs)
    - Regex search, go to line functionalities
    - Pipe selection through arbitrary command
    - Pipe selection through predefined command(s)
    - Syntax highlighting
    - Line numbers, current line highlightnig
    - Simple autoindenting
    - Multi-level undo
    - Configurable at compile-time
    Dependencies
    - GtkSourceView2
    - Gtk+2
    - (probably) xorg-utils to get xprop to set XProperties
    - one method to grab user input: either zenity or dmenu in the pre-defined config files
    Screenshot
    http://sandyeditor.sf.net/sandy_editor.jpeg
    Homepage
    http://sandyeditor.sf.net/
    Download
    http://sourceforge.net/projects/sandyed … z/download
    AUR
    http://aur.archlinux.org/packages.php?ID=36084
    Comments, bug reports and patches welcome.
    Last edited by rafunchi (2010-04-13 23:24:26)

    Procyon wrote:
    It would be nice to be able to do something like this:
    1 abc
    2 dec
    3 abd
    4 edc
    5 {CURSOR}ad
    ^R, sed command: 1,3s/^/%%%/
    1 %%%abc
    2 %%%dec
    3 %%%abd
    4 edc
    5 {CURSOR}ad
    So you can edit and continue where you left off.
    The problem with implementing this behavior is 'sed' is an external command here. The full text is filtered through sed and put back in the buffer, not just lines 1 to 3. You can't just preserve the insert position as the text coming from the pipe might be completely different from your original. Same for searching the current line.
    You *could* remember your line+char position and move the cursor back there, but this would be highly unreliable and move the cursor to a third position in the buffer if your 's' command changes the number of lines (e.g. try s/:/\n/g in a password file)
    Also, a couple of tests with vim prove that it does not behave consistently in this regard, despite :s being an internal command there.
    if you really want to add '%%%' at the beginning of the line quite often, I suggest you define a binding or action for:
    t_editable, t_pipelines, { .v = (char *)"sed \'s/^/%%%/\'" }
    Then select the lines you want to target lousily (you don't need to select full lines) and launche the binding/action. It does move the cursor, but seems fairly quick.
    Procyon wrote:Maybe you can check for "/^s/" in the command to make it work on this current line, just like vim's :s///
    I made a wee change in the hg tip code. Now sandy "listens" to three properties regarding pipes:
    - _SANDY_PIPE: Pipes the selected text, or nothing by default as per f_pipe. This is used by the ^I binding in the default config.
    - _SANDY_PIPEALL: Pipes the selected text, or the full file if nothing is selected as per f_pipeall. This is used by the ^P binding in the default config.
    - _SANDY_PIPELINES: Pipes the selected text, extending the selection to full lines and matching the current line if there is no selection as per f_pipelines. This is used by the ^R binding in the default config. This means now sed is applied to full lines if there is a selection and to the current line if there is not.
    Thanks for your feedback. I hope this helps.

  • The Find function (Ctrl+F), mis-finds the desired simple text in Acrobat Standard, but works fine in Reader

    Adobe Acrobat X 10.1.13, Win 7 64bit, 
    The Find function (Ctrl+F), mis-finds the desired simple text. 
    This is not a scanned document.  When I search for some word that DOES exist in the document, Acrobat will highlight text that does not match at all and which does NOT contain the word.  If I select the actual word, copy and past the text, I get the selected text accurately, but when I paste the same selected text into the Find box to search for it, Acrobat still mis-finds. 
    HOWEVER, I can open the very same .PDF file in Acrobat Reader X and do not have the same problem - Find works correctly in Reader with the same .PDF. 
    What is going on?!  Both Acrobat standard, and Reader report that they are up to date.   Please help.

    Can you try rasterizing (converting the document to tiff/bmp) and then importing those image files (tiff/bmp) back in Acrobat.
    This would allow document to be re-OCRed and you will be able to search text in it. You can use lossless export/import settings to preserve the quality of ducment.
    For exporting the file:
    1: Go to File > Save As Other > Image > Tiff.
    2: Click on Settings button in the Save As Dialog and set the file settings as ZIP for Monochrome, Grayscale and Color.
    Now for importing the files back:
    1: Press Ctrl + K
    2: In the Preferences dialog, select Convert To PDF option in Categories.
    3: Choose tiff or bmp (as per the format used while exporting) and un-check Scan Optimization and OCR.
    4: Set Color and Grayscale to Zip and Monochrome to CCITT G4.
    5: Save the settings.
    6: Now import all the pages in Acrobat.
    7: You can use Combine Files feature to merge all the image files.

Maybe you are looking for