How to Print in the desired format

Hi, I'm pretty new to this site. I've some problem in printing out in the format that i was looking to.
for(i=0;i<3;i++)
for(j=0;j<3;j++)
if(a==0)
out[i][j]=3;
}//end of if
if(a==1)
out1[i][j]=2;
}//end of if
}//end of j
}//end of ii had some kind of coding for that 'a' value to change from 0 to 1
Upon doing all the kind of computations the data that is present is out[][] array is as follows:
3 3 3 3 3
3 3 3 3 3
3 3 3 3 3
3 3 3 3 3the data that is present is out1[][] array is as follows:
2 2 2 2 2
2 2 2 2 2
2 2 2 2 2
2 2 2 2 2now that I want to print the output as follows:
3 2 3 2 3 2 3 2 3 2
3 2 3 2 3 2 3 2 3 2
3 2 3 2 3 2 3 2 3 2
3 2 3 2 3 2 3 2 3 2that is the way i like the output to be printed is: Upon printing all the rows of the 1st column of out[][] array, i need all the rows of 1st column of out1[][] array to print. This process continues all the columns of both arrays were printed.
is there any way to print that way. is there a possibility to print that way.
Any advice is appreciated. :)
Thanks in advance
Edited by: netbeans2eclipse on Sep 8, 2008 9:41 AM
Edited by: netbeans2eclipse on Sep 8, 2008 9:42 AM
Edited by: netbeans2eclipse on Sep 8, 2008 9:43 AM

View the problem like this : print the elements of out[][] and out1[][] alternatively. i.e.
print an element of out[0][0]
print an element of out1[0][0]
print an element of out[0][1]
print an element of out1[0][1]....
Something like this :
I have not tested the code. So you may need some modification to logic.
for(i=0;i<3;i++)
         for(j=0;j<3;j++)
                 System.out.print(out[i][j]);
                 System.out.print(" "+out1[i][j]);
}

Similar Messages

  • How  i can implement the desired format in ODI ??

    Hi
    i want to export data from table to file
    but in file i have specific format like
    Account Number :A123456
    Cutomer 1
    Customer 2
    Customer 3
    Account Number : B999999
    Cutomer 4
    Customer 5
    Customer N
    How i can implement this
    plz suggest me possible solutions for this
    thanks

    Hi,
    I have done this before by using three files. The first file contains the header row - in your case, I would create a variable which selects the account number via rownum for example (you could add another variable so you could increment the rownum until exhausted). Then in the first ODISqlUnload
    select 'Account Number :'||#variable.account_number
    from table.
    This creates you header row in a file
    Then, in a second ODISqlUnload, select the 'Customer' data for the account number into another file
    select customer_details
    from table
    where account_number = #variable.account_number.
    So you end up with a list :
    Customer 1
    Customer 2
    etc etc
    Then using an ODIFileAppend, append the two files created above in the final output file. Then loop round in a package for all your account numbers, using the two temp files, then append to the final output.
    Your final output file, then looks like:
    Account Number :A123456
    Customer 1
    Customer 2
    Customer 3
    Account Number : B999999
    Customer 4
    Customer 5

  • How to print text in paper format iin smartforms

    Hi all,
      I want a question that  how to print text in paper format like  paper divides into 2 parts and if the firstpart is full of text i.e., it exceeds the first page the text will be displyed in the second part of the first page.
    Usefull answers will be awarded.
    Thanks all...

    Hi,
    U create two windows in the page and same as like second page.
    but in first page first window select the condition print only on first page.
    in second window select conditin print only on second page.
    first try without creating a secondpage. if that doesn't workout create secondpage and try.
    Assign points if useful.
    Regards
    (YUGANDHAR.P)

  • How does one change the date format for PlayMemories Home folders?

    I am using PlayMemories Home Version 2.0.00.11271 and have many folders within it which contain only photographs imported from my Sony DSC-H9.  Unfortunately, PlayMemories Home insists upon dating all folders in a month/day/year manner; and this makes little sense if one wishes to have the folders listed in logical chronological order.  How can I change the date format to year/month/day?  Changing the name of each folder, one by one, will take a very long time!  Your helpful advice in this matter will be greatly appreciated.  Thank you. System information:
    Operating system: Microsoft Windows XP Professional
    Service pack : Service Pack 3
    Memory: 1.5 GB
    Processor:         Intel(R) Pentium(R) M processor 1.86GHz
    Max. clock speed: 1.86
    Manufacturer: IBM
    Model: 1847W76
    System language setting: English (United States)
    User language setting: English (United States) 

    I too thought that the folder naming format was obviously wrong and couldn't find a way to change it. I do agree that placing photos in folders according to when they were taken is a great idea. I had been considering writing some software to do just that. After discovering that PlayMemories does it, I had it re-import all my photos. Then I wrote a small Perl script to rename all of the folders into year-month-day format. Included here is the Perl script. It only acts on a single folder - use it on the root folder where all the PlayMemories folders are. It will rename all folders currently in a month-day-year format. I used it without problems but of course there is no guarentee that it is error free. This should work with any common version of Perl. Tom # There should be one command line argument: the directory to act upon
    if ( scalar(@ARGV) == 0 ){
     print "Usage: RenameDirs <dir>\n";
     print " Where dir is the directory containing the directories to rename.\n";
     exit;
    $mydir = $ARGV[0];
    chdir $mydir or die "Couldn't chdir to $mydir: $!";
    opendir(ROOTPHOTODIR, ".") or die "Failed to open the pictures directory $mydir: $!";
    @allphotodirs = readdir ROOTPHOTODIR;
    closedir ROOTPHOTODIR;
    foreach $dir (@allphotodirs) {
     if ( -d $dir ) {
      print "$dir is a directory";
      if ( $dir =~ /^(\d{1,2})-(\d{1,2})-(\d{4})$/ ) {
       print " and has the proper format: month $1 day $2 year $3 and will be renamed to ";
       $newname = sprintf "%4u-%02u-%02u", $3, $1, $2;
       print "$newname\n";
       rename $dir, $newname or die "failed to rename $dir to $newname: $!";
      else {
       print " but is not of the proper format\n"
     elsif ( -f $dir ) {
      print "$dir is a file\n";
     else {
      print "$dir is neither a directory nor a file\n";
    }

  • How can we give the Data Format (File Type ) in Runtime

    Hi all,
    How can we give the Data Format (File Type ) in Runtime for the following method,
    cl_gui_frontend_services=>gui_download.
    Thanks in advance
    Sri

    There is a filetype parameter which you can set
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
    *    BIN_FILESIZE              =
        filename                  =
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      changing
        data_tab                  =
    *  EXCEPTIONS
    *    FILE_WRITE_ERROR          = 1
    *    NO_BATCH                  = 2
    *    GUI_REFUSE_FILETRANSFER   = 3
    *    INVALID_TYPE              = 4
    *    NO_AUTHORITY              = 5
    *    UNKNOWN_ERROR             = 6
    *    HEADER_NOT_ALLOWED        = 7
    *    SEPARATOR_NOT_ALLOWED     = 8
    *    FILESIZE_NOT_ALLOWED      = 9
    *    HEADER_TOO_LONG           = 10
    *    DP_ERROR_CREATE           = 11
    *    DP_ERROR_SEND             = 12
    *    DP_ERROR_WRITE            = 13
    *    UNKNOWN_DP_ERROR          = 14
    *    ACCESS_DENIED             = 15
    *    DP_OUT_OF_MEMORY          = 16
    *    DISK_FULL                 = 17
    *    DP_TIMEOUT                = 18
    *    FILE_NOT_FOUND            = 19
    *    DATAPROVIDER_EXCEPTION    = 20
    *    CONTROL_FLUSH_ERROR       = 21
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24

  • My computer crashed, how do i download the digital format of adobe photoshop elements (I have the cd

    my computer crashed, how do i download the digital format of adobe photoshop elements (I have the cd version, redemption code and serial #) to my new computer which does not have a cd drive

    if you follow all 7 steps you can dl a trial here:  http://prodesigntools.com/photoshop-elements-11-direct-download-links-pse-premiere-pre.htm l
    and activate with your serial.
    if you have a problem dl'g, you didn't follow all 7 steps.  the most common error involves failing to meticulously follow steps 1,2 and/or 3 (which adds a cookie to your system enabling you to download the correct version from adobe.com).

  • How can I change the date format in Reminders and in Notes?

    How can I change the date format in both Notes and Reminders? Preference on Imac and Settings in IOS do not allow me to change the format in those 2 apps.
    I Like to see 10oct rather than 10/10, as an example.

    pierre
    I do not have Mavericks or iOS - but the first thing I would do is reset the defaults - I'll use Mavericks as an example
    From If the wrong date or time is displayed in some apps on your Mac - Apple Support
    OS X Yosemite and Mavericks
        Open System Preferences.
        From the View menu, choose Language & Region.
        Click the Advanced button.
        Click the Dates tab.
        Click the Restore Defaults button.
        Click the Times tab.
        Click the Restore Defaults button.
        Click OK.
        Quit the app where you were seeing incorrect dates or times displayed.
        Open the app again, and verify that the dates and times are now displayed correctly.
    Then customize to taste - OS X Mavericks: Customize formats to display dates, times, and more
    OS X Mavericks: Customize formats to display dates, times, and more
    Change the language and formats used to display dates, times, numbers, and currencies in Finder windows, Mail, and other apps. For example, if the region for your Mac is set to United States, but the format language is set to French, then dates in Finder windows and email messages appear in French.
        Choose Apple menu > System Preferences, then click Language & Region.
        Choose a geographic region from the Region pop-up menu, to use the region’s date, time, number, and currency formats.
        To customize the formats or change the language used to display them, click Advanced, then set options.
        In the General pane, you can choose the language to use for showing dates, times, and numbers, and set formats for numbers, currency, and measurements.
        In the Dates and Times panes, you can type in the Short, Medium, Long, and Full fields, and rearrange or delete elements. You can also drag new elements, such as Quarter or Milliseconds, into the fields.
        When you’re done customizing formats, click OK.
        The region name in Language & Region preferences now includes “Custom” to indicate you customized formats.
    To undo all of your changes for a region, choose the region again from the Region pop-up menu. To undo your changes only to advanced options, click Advanced, click the pane where you want to undo your changes, then click Restore Defaults.
    To change how time is shown in the menu bar, select the “Time format” checkbox in Language & Region preferences, or select the option in Date & Time preferences.
    Here's the result AppleScript i use to grab the " 'Short Date' ' + ' 'Short Time' "  to paste into download filenames - works good until I try to post it here - the colon " : " is a no-no but is fine in the Finder
    Looks like iOS Settings are a bit less robust
    - Date/Time formats are displayed according to 'tradition' of your region > http://help.apple.com/ipad/8/#/iPad245ed123
    buenos tardes
    ÇÇÇ

  • How do I change the number formatting within a Cell Table in Microsoft Word?

    Hi, I was wondering if someone could help me out on an issue I've been having... I work for an accounting firm and we do a lot of financial statements. 
    I was wondering if we would be able to treat a cell table in Microsoft Word 2007 like I would a cell table in Microsoft Excel. Meaning, I would like to change the formatting of the numbers in the table to the "Accounting" (number) format so it
    aligns by the decimal point and use the $ signs and () for negative numbers.  We do use the link tables feature, however, most of our balancing pages just can't be done in Excel because of the way the text is written. It would be much harder to format
    the text if it were to be typed in Excel. We have also tried  creating an Excel sheet within Microsoft Word but it is the same as linking the tables... Again, a text formatting issue.  The only option is to use tables within Word but how do we change
    the number formatting to a "accounting" (number) format where the numbers would align with the decimal point and use () for the negative numbers. Is there ANY option for us to do this other than manually entering this information in using tabs?  
    If there are no options other than entering it in manually, please consider this as an option for your next software update. I believe that a LOT of people out there will be interested in this feature... My manager and I just attended a webinar on Microsoft
    Advanced Word Tips Tricks and Techniques and 75% of the attending people had this question but no answer.
    Thank you very much for your help!!!!!

    Word does not really have number formatting for table cells. You can align cell contents on the decimal point, though, by setting a so-called decimal tab stop.
    Option 1:
    - Select the cells for which you want to do this.
    - Display the ruler.
    - Click the Tab box on the left hand side of the ruler until the box contains an inverted T with a dot.
    - Click in the ruler where you want the decimal tab.
    Option 2:
    - Select the cells for which you want to do this.
    - Click the arrow in the lower right corner of the Paragraph group on the Home tab of the ribbon.
    - Click the Tabs... button in the lower left corner of the dialog.
    - Specify a tab position in the box, e.g. 1.5".
    - Select the 'Decimal' radio button under 'Alignment'.
    - Click Set.
    - Click OK.
    You will have to type the numbers as they should appear, including the $ for currency and the ( ) for negative numbers.
    Regards, Hans Vogelaar

  • How to print form into pdf format using smart forms in abap

    please let me know how to print form into pdf format using smart forms in abap.
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Mar 25, 2011 2:04 PM

    Hi ,
    refer this link
    <removed by moderator>
    Regards,
    Dhina..
    Moderator message: please do not reply to questions that violate forum rules.
    Edited by: Thomas Zloch on Mar 25, 2011 2:04 PM

  • How can I copy the kindle format books on my iPad to my Linux PC.?

    My iPad battery is dying/dead.  How can I copy the kindle format books on my iPad to my Linux PC?  Because i understand they'll be lost when i get Apple to 'fix' my battery.

    Meg, thanks but these are Science Fiction books from Baen Books directly.  I realize I could go back to the publisher and redownload them but there are 100+ books and I'd like to avoid that.  What I'd prefer to do is to find where they are on the IPad and then copy them to my PC and then be able to copy them back to the replacement iPad.
    Does anyone know how to do that?

  • How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    Date, time and currency formats are controlled via Settings > General > International > Region Format - you can't just change the date format

  • Can't figure out how to print on the right side of a greeting card using a 5X7 when folded

    I have a HP Officejet Pro 8500A.   I am trying to print a greeting card, but cannot figure out how to print on the right side of the paper so that it's on the correct side when folded.    The paper is 5X7 when folded, 10X7 laid flat.

    shgilljx,
    Welcome to the forums. I will try to explain this in simple terms, and you'll have to play with it. We'll use plain paper, cut to 10x7. You'll need a marker, 4-5 sheets of paper.  
    Lay paper flat, number top 1, bottom 2. Flip paper over right to left. number top 3, and bottom 4.Draw a line where the fold would be on each page.1) Put paper with number 3 side up in printer.
    To create both templates using MW Office, do this. The requires 2 documents. One is graphic, one is text.
    Text template: The text will be printed on number 2.  That means your wording must be within the bottom half of the page.
    Graphic template: The image must be rotated 180 degrees.The image must be within the top half of the page.
    Print the text template. Insert side #3 into the printer. The text should print on side #2.
    Print the graphic template: Insert side #1 into the printer. The graphic should print on side #3.
    When folded, all should be correct, if I did it right.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • How to print out the position of 2 dimension arrays?

    there are 2 dimension arrays, how can print out the position of value than 4?
    for example
    0 2 3 2 2 2
    0 1 1 2 5 3
    1 2 3 3 2 1
    print out:
    The pos is ( 5,2).

    Hello
    If I understand your question correctly, you are trying to print out the indexes where the value in your matrix is greater than 4
    If this is the case, then what you need to use is nested for loops e.g.
    for (int i = 0; i< array[0].length; i++)
    for (int j = 0; j< array[].length; j++)
    int value = array[i][j];
    if (value > 4)
    System.out.println("The pos is (" + i + "," + j + ")" );
    Regarding the syntax I have used to get the size of the array, I am not sure if this is correct, but you should have an idea of what I am doing.
    Sajid

  • How do you change the page format to print a larger area?

    Hi there, another new to mac and new to numbers guy.
    I'm trying to find the windows equivalent to change page format.
    I want to reduce the blank border surrounding my table and print a larger area. How do you reduce the blank border that prevents you from printing up to the paper edge?
    cheers

    Page margns in Numbers are set in the Layout Inspector.
    Open the Inspector and click the Layout button.
    Edit the four margin settings as you wish. Reduce the (page) header and footer settings to zero if you don't want to include running headers or footers on your pages.
    Note that margins will be limited by the capabilities/settings of your printer. Printing to the edges of the paper usually requires a choice to be made in the Print dialogue as well as for the document itself.
    Regards,
    Barry

  • How to print out the informations of mp3 for the format of TagContent?

    I can get the mp3 title, but when i try to print it out, it is the wrong code...
    i know the format of title is TagContent .
    But how to print such " TagContent " format by system.out.print?
    Here's my code :
    import de.vdheide.mp3.*;
    import java.io.*;
    public class c
    public static void main (String [] args) throws IOException
    try
    MP3File mp3 = new MP3File("fly.mp3");
    System.out.println( mp3.getTitle());
    catch (Exception e)
    }

    Hello
    If I understand your question correctly, you are trying to print out the indexes where the value in your matrix is greater than 4
    If this is the case, then what you need to use is nested for loops e.g.
    for (int i = 0; i< array[0].length; i++)
    for (int j = 0; j< array[].length; j++)
    int value = array[i][j];
    if (value > 4)
    System.out.println("The pos is (" + i + "," + j + ")" );
    Regarding the syntax I have used to get the size of the array, I am not sure if this is correct, but you should have an idea of what I am doing.
    Sajid

Maybe you are looking for