Open multiple files at the same time

Dear everyone,
Suppose we have an array of millions of integers, we wanna create 10 files:
0.txt (stores the integers in that array whose last bit is 0.)
1.txt (stores the integers in that array whose last bit is 1.)
2.txt (stores the integers in that array whose last bit is 2.)
3.txt (stores the integers in that array whose last bit is 3.)
and so on.
One solution to this is to look at each integer and then decide which file to OPEN and to write to. But this will result in a waste of time spent on opening and closing files repeatedly.
So I am considering if we can OPEN all those files in the beginning, and then look at each integer to decide to which file to write to. Once all integers have been gone through, CLOSE all files.
But I am not so sure if this will lead to more memory use, whether or not all the file content will be loaded into RAM as the file is OPEN.
Also, can anybody give me some idea how I can implement this.
Thanks in advance!

Dear everyone,
Suppose we have an array of millions of integers, we
wanna create 10 files:
0.txt (stores the integers in that array whose last
bit is 0.)
1.txt (stores the integers in that array whose last
bit is 1.)
2.txt (stores the integers in that array whose last
bit is 2.)
3.txt (stores the integers in that array whose last
bit is 3.)
......A bit can only be 0 or 1. If you want to interpret the low order as the file number, you'll need to rethink it:
0000 --> 0
0001 --> 1
0010 --> 2
0011 --> 3
1001 --> 9
1010 --> ?
1011 --> ?
... etc.
So I am considering if we can OPEN all those files in
the beginning, and then look at each integer to
decide to which file to write to. Once all integers
have been gone through, CLOSE all files.Yes, you can do that.
But I am not so sure if this will lead to more memory
use, whether or not all the file content will be
loaded into RAM as the file is OPEN.The files' contents are only loaded into memory if you explicitly do so by reading them. If you're just opening and writing, the files' contents will no be loaded into memory.
Also, can anybody give me some idea how I can
implement this.What specific questions do you have? It's not clear what you're trying to do or what trouble you're having.
You might want to start here:
http://java.sun.com/docs/books/tutorial/essential/io/index.html

Similar Messages

  • CRVS2010 - open multiple rpts at the same time, like sheets in a xls file ?

    Hi all,
    is that possible to open multiple reports at the same time, like sheets in a excell file ?
    Is that possible create tabs beside the MainReport tab ? or include reports in the Group Tree ? how can I do it ?
    The application is in asp.net with VS2010 and CR2010.
    The reports used to be in excell with three sheets and now we are migrating them to crystal reports, how can I create the report with those three sheets ?
    thanks !
    Subject modified as per the sticky post at the top of this forum; [Crystal Reports for Visual Studio 2010 Beta - read before posting|Crystal Reports for Visual Studio 2010 Beta - read before posting;
    Edited by: Ludek Uher on Aug 31, 2010 7:33 AM

    I'll make the suggestion to the Program Management group.
    You may want to do a post to the [Crystal Reports Design|SAP Crystal Reports; forum and ask them how they's fake that sort of a requirement. E.g.; there may be some way to make this report look the way you want, but it will be best to ask the experts. Don't mention CRVS2010 as they don't support it and most likely you will not get an answer.
    Ludek

  • Is there any version of Indesign that allows to open multiple instance at the same time

    I am using Indesign CS3 to generate the bulk reports automatically(programmatically) using Adobe indesign library . One of the key limitation to this tool is it allows to open only one instance at a time unlike word where multiple instances can be opened at the same time. Is there any adobe indesign too version desktop/server which allows to open multiple instances at the same time. Any help on is appreciated. Thanks.

    @PeterG
    You said "You might want to examine the End User Licensing Agreement (EULA) for  any prohibition against using these two instances at the same time with  the same license; the license does permit two installs for the same user  that are not used simultaneously." I thought that meant you had read the EULA. It's pretty unambiguous on that point.
    For everyone's edification about multiple installations and server use with a standard license here's the relevant text:
    2. Software License.
    If you obtained the Software and any required serial number(s) from Adobe or one of its authorized
    licensees and as long as you comply with the terms of this agreement, Adobe grants you a non-exclusive
    license to install and use the Software in a manner consistent with its design and Documentation and as
    further set forth below. See Section 16 for specific provisions related to the use of certain products and
    components, for example font software, Acrobat, After Effects, Adobe Presenter, Contribute, Adobe
    Device Central, Flash Player, Flash Builder, and Adobe Runtimes.
    2.1 Limited Use. The Software, or portions of the Software, may allow installation and use without a serial
    number. If so, you may install but not use such non-serialized Software on any number of Computers as
    part of an organizational deployment plan. Further, you may install and use such non-serialized Software
    on any number of Computers for demonstration, evaluation and training purposes only and only if any
    Output Files or other materials produced through such use are used only for internal, non-commercial and
    non-production purposes. You may not use such non-serialized Software after any applicable time-out
    period has ended, unless you input a valid serial number under Section 2.2. ACCESS TO AND USE OF
    ANY OUTPUT FILES CREATED WITH SUCH NON-SERIALIZED SOFTWARE IS ENTIRELY AT
    YOUR OWN RISK.
    2.2 General Use. You may install and use one copy of the Software only on the Permitted Number of your
    compatible Computers into which you enter a valid serial number.
    2.3 Distribution from Server. You may copy an image of the Software onto Computer file server(s) within
    your Internal Network for the purpose of downloading and installing the Software onto Computers within
    the same Internal Network for use as permitted by Section 2.1 and 2.2.
    2.4 Server Use. You may install the Software on Computer file server(s) within your Internal Network only
    for use of the Software initiated by an individual from a Computer within the same Internal Network only
    as permitted by Section 2.2. The total number of users (not the concurrent number of users) able to use the
    Software on such Computer file server(s) may not exceed the Permitted Number.
    By way of example, the foregoing does not permit you to install or access (either directly or through
    commands, data or instructions) the Software: (a) from or to a Computer not part of your Internal Network,
    (b) for enabling Web hosted workgroups or services available to the public, (c) by any individual or entity
    to use, download, copy or otherwise benefit from the functionality of the Software unless licensed to do so
    by Adobe, (d) as a component of a system, workflow or service accessible by more than the Permitted
    Number of users, or (e) for operations not initiated by an individual user (e.g., automated server
    processing).
    2.5 Portable or Home Computer Use. Subject to the important restrictions set forth in Section 2.6, the
    primary user of the Computer on which the Software is installed under Section 2.2 (“Primary User”) may
    install a second copy of the Software for his or her exclusive use on either a portable Computer or a
    Computer located at his or her home, provided that the Software on the portable or home Computer is not
    used at the same time as the Software on the primary Computer.
    2.6 Restrictions on Secondary Use by Volume Licensees. If the Software was obtained under an Adobe
    volume license program (currently known as Adobe Open Options) by any licensee other than an
    educational volume licensee, the second copy of the Software made under Section 2.5 must be used solely
    for the benefit and business of that volume licensee. For more information about secondary use by volume
    licensees, please visit our Web Site at http://www.adobe.com/go/open_options.
    There is also language stating that if you have a dual boot or other system capable of running more than one OS you will need a separate license for each platform if you want to run the software on more than one.

  • Can you opening multiple albums at the same time in Photo (not iPhoto)?

    When converting the iPhoto library to Photo most of the albums that were in place in iPhoto converted to albums in Photo . . . .but not all. Some were retained as events mainly those that were folders within an album. In order to move them to the right album I would like to have multiple albums open at the same time (side by side) so that I can make sure not to duplicate photos or move them to the wrong spot.
    I cant see how to do this, it seems that I can need to open one album and check phots and then close to look within and other and rely on memory. There must be a more efficient and accurate way to do this?

    All of the events in iPhoto were converted to albums and are located in the Folder titled iPhoto Event in the sidebar of Photos. 
    You can't open multiple albums at the same time.  You can create a smart album that will do essentially the same thing with the following criteria:
    Album is "A"
    Album is "B".
    The smart album will display all of the photos in those two albums.

  • Is it possible to upload multiple files at the same time?

    Hi folks,
    It seems pretty trivial to implement a file upload item, but is there some way to allow selection (upload) of multiple files at the same time? Seems like this has probably come up before, but I didn't find much for solutions in my search. Any links or insight would be appreciated.
    Thanks!
    -Adam vonNieda

    Thank you both for your replies.
    @Manish - That does allow for multiple file uploads without refreshing the page, but does not allow for multiple file uploads at the same time.
    @Tony - That might be the way I end up going, although I probably should have been more specific. It would be really nice it there was a way to do a mutli-file select using the control or shift button like you can with a standard file selection dialog (if you want to copy multiple files, for example). Having a separate line for each file browser means there has to be a limit on the number that can be selected at the same time.
    Has anyone implemented a method of selecting multiple files at once, and hitting an upload button once to get them into the database?
    Thanks again Manish and Tony, very helpful.
    -Adam

  • How to open multiple applications at the same time

    I need to open several applications at the same time: Dreamweaver, BBEdit, and Acrobat. Is there a way to smooth this process, so pressing an icon in the dock will open them all for me?

    You could create an applescript to do it.
    tell application "Dreamweaver's Full Name"
    activate
    end tell
    tell application "BBEdit's Full Name"
    activate
    end tell
    tell application "Acrobat's Full Name"
    activate
    end tell
    Replace the quoted text (leaving the quotes) with the full name of the application, and save the applescript as an application bundle, and put it in your dock.
    NOTE: You may have to put the full path to the application for it to work (I.E. /Applications/Dreamweaver.app). If you do, encase the full path in quotes.
    Good luck!
    Message was edited by: joshz

  • Cant open multiple profiles at the same time on Outlook.

    So i have done some research and found that you can use command line switches to open different profiles in Outlook.
    e.g. "C:\Program Files\Microsoft Office\Office15\OUTLOOK.EXE" /profiles "ProfileName"
    What i want to do is open two different profiles at the same time. So i already have one profile open, i use the method above, however it simply opens a copy of the profile i already have open rather than the one i defined in the command line switch?
    I know it works because if i don't have a profile open it opens the profile i specify. Is this by design? If so what is the point in having a profile switch? If someone could help me get this working it would be great.
    Thanks in advance.

    Hi Eric,
    Thanks for confirming this. We already have all the mailboxes that she wants on her main profile. The problem is that Outlook cant handle processing all of these at the same time and continuously crashes and hangs. As i said previously the .ost for her profile
    was 16GB, i have managed to reduce to 9GB but Microsoft themselves say that anything above 5GB needs extra hardware power for a good user experience.
    http://support.microsoft.com/kb/2695805/en-gb 
    Up to 5 gigabytes (GB): This file size should provide a good user experience on most hardware.
    Between 5 and 10 GB: This file size is typically hardware dependent. Therefore, if you have a fast hard disk and lots of RAM, your experience will be better. However, slower hard disk drives,
    such as drives that are typically found on portable computers or early-generation solid-state drives (SSDs), experience some application pauses when the drives respond. 
    More than 10 GB: When the .ost file reaches this size, short pauses begin to occur on most hardware.
    Very large (25 GB or larger): An .ost file of this size increases the frequency of short pauses, especially while you are downloading new email messages. However, you can use Send/Receive
    groups to manually sync your mail. For more information about Send/Receive groups, see the "Are you synchronizing many RSS feeds?" section.
    I find it surprising that you cant have multiple profiles with different mailboxes when you consider you can only have an .ost up 5GB to have a good user experience. Maybe this is something the developers can put into the next version of Outlook? Or release
    as a patch?

  • How do you rename multiple files at the same time

    how do you rename multiple photo files with a name at the same time?

    This would be an excellent use of Automator. Here is a link to some instructions on how to do this using Automator.
    http://www.youtube.com/watch?v=Ie6zGxo2D-o
    If you don't like that then Google "Renmame multiple files Automator" and you will find many tutorials available.

  • How top open multiple forms at the same time in HRMS menu

    Hi,
    When enabling "Close Other forms" in HRMS menu by excluding the function ‘Navigator: Disable Multiform’ Function in the Responsibility Definition (System Administrator -> Security -> Responsibility -> Define), mutliple forms works fine but I'am facing another error.
    My problem is: when this option is enabled, I tried to run Payroll run request but it turned out that payroll list of values is returning empty values and I'am unable to select any payroll from list of values. the only way to do so is to remove back ‘Navigator: Disable Multiform’ Function from exclusion section in responsibility.
    My requirment is: to have multiple form and payroll run list of values working at the same time
    Thanks

    Reason for this , if ur request is attached to more than 1 responsibility , i think this issue will come , we got same issue
    we remove it from responsibility list , then it is working fine

  • How do i rename multiple files at the same time on a MAC?

    I have been a mac user since 4 years now yet i cannot figure out how to rename multiple files in mac. In Pc i used to slect all and rename one e:g "ab.jpg" and the restwould be "ab (1).jpg" automatically. but in the mac its way too hard to do this on the automator. ..
    please advise asap!
    ~haniah

    You can do it with Automator.
    http://www.automator.us/examples-01.html
    Or with a utilities like these:
    http://www.publicspace.net/ABetterFinderRename/
    http://renamer4mac.com/
    You can also do it using the Terminal command line.
    Matt

  • Opening multiple pages at the same time

    Hi.
    We are currently developing a few custom pages which we are calling from Oracle Applications responsibility. The pages are registered as individual functions and we call them from the applications menu structure. However when we have more than 1 page open from the menu structure, we are getting the following errors:
    " Error: Stale Data
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The number of displayed records, 2, exceeds the actual number of records, 0, in view object ClaimEstimationAM.EstLinesVO2. Some of the displayed records may have been deleted.
    To proceed, please select the Close Window link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward. "
    We normally get this error after we have committed/saved from one of the open pages. The error appears on the page where we didn't do the commit, and it immediately appears once we start doing something on that page.
    Does anyone have any idea why we are getting this error? When there is only 1 page open, there are no problems going through the processes in the page, but once we open up a second page (not necessarily the same page, it's a different function altogether), calling it from the menu, then one of the open pages start to get this error. Any help is very much appreciated.
    Thanks and Regards,
    Narissa

    Hi Gaurav.
    Thought I'll mention how I set up the HTML page from the Oracle Apps Function setup.
    Function: COZF_PP_CLAIMS_ESTIMATION_PG
    Type: SSWA jsp function
    Web HTML: OA.jsp?page=/tap/oracle/apps/xxcozf/ppclaims/webui/EstimateSummaryPG
    Function: COZF_SERIAL_NUM_INQUIRY
    Type: SSWA jsp function
    Web HTML: OA.jsp?page=/tap/oracle/apps/xxcozf/ppclaims/webui/SerialNumberInqPG
    Both pages are for inquiry, but users can drill-down (to a new page) to see detailed information via link or button. Same thing if user wants to update the information, an image icon is provided to open up an update page.
    Again, if there's only 1 page open, no problem with processing. But once a second page is opened simultaneously, either of the page gets lost.
    Any idea?
    Thanks,
    Narissa

  • Is it possible to open multiple files in the same window

    I just upgraded from Reader 8.1.0 to 9.2 and whenever I open multiple pdfs it opens a new window.
    Is there a way to prevent this. If didn't happen in 8.1.0.
    Aditya

    Thank you for the brilliant idea.....
    How about in 9.2 ?

  • Can I export multiple files at the same time in Premiere CS5.5?

    I have 10 hours of total video.  I need to cut them up into small  <5 minutes clips to play on a clients website.  Rather than exporting one clip at a time, i'd like to do them all at once and save them as individual files.. it that possible?  I thought now, as each small file would need it's own file name.
    John Q.

    You can do a batch export by sending them to Adobe Media Encoder with the Queue button in the export settings dialog.
    However, you will have to set up each export one at a time.

  • How to support multiple users at the same time?

    Hi all,
    I have a Labview software which controls a analyzer via GPIB connector. When user A is using the software, user B has to wait until A is done. But actually, the analyzer is not very busy, when user A is using the software.
    I want user A, B, C and D can use the software at the same time. just like we can open Multiple websites at the same time.
    How can I program the software, so that the software can be open multiple times? Do you have any example?
    Thanks a lot.
    Steven
    Solved!
    Go to Solution.

    Are all the users going to be measuring the exact same thing from the same instrument?
    It would be possible to write a separate instrument server application that would handle all the direct interactions with the instrument. When one of the users needed to access the instrument, they would gain access to it through this server.
    The big, Big, BIG caveat is that each interaction with the instrument would need to be atomic. In other words each access would need to configure the instrument, initiate the reading, report the results, and then reset the instrument back to some known default value.
    As Dennis said, not a trivial process, but probably do-able...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How can I open multiple files as Photoshop Raw files at the same time for Photoshop CS6 extended on a PC?

    I am trying to open 20-25 files at the same time as Photoshop Raw [*.RAW] files.
    The only way I can open multiple files is if i leave the file type as All Formats. When I change it to  Photoshop Raw [*.RAW], the files a deselected.

    Use bridge. Select all the files then press ctrl-r or cmd-r to load the selected files into camera raw.
    If you try this in Photoshop use File>Open As then for file type choose camera raw. (I have not tested open as for opening multiple files)

Maybe you are looking for

  • Adding  some more  line  items  in  the  unconfirmed  Transfer Order

    Hi  All,      We do kitting activity at our warehouse i.e. several components make up an assembly of a particular final product. The WH creates a production order(BOM) based on which the system creates TO wherever stock of individual components are a

  • K9AGM3 motherboard won't start if JPW1 is plugged in.

    Have had the motherboard for about 5 years working fine apart from the pcei graphics card slot getting a bit iffy and needing to be plugged in very carefully or I end up getting weird lines on my screen if it is bumped, but yesterday my pc was left o

  • Express document "Art. segments not generated correctly" received from aut

    Art. segments not generated correctly     dear all    i created an article in MM41. while doing the listing in WSM3 this error is occurring same plant i was created artilces and listed also but today it is showing this error msg . Can u please sugges

  • 3.5mm headphone jack snapped off inside headphone port.

    Hi guys, Last night the 3.5mm jack on the end of my headphones snapped off inside the macbook's headphone socket. Its about 4mm inside the port, and so is on the other side of the first set of copper 'bumps' (i think they are copper, they look it)...

  • Debug of the Alchemy C part

    Hello, How to debug the C part of my Alchemy library when I am with my project and Flex Builder, since the code in C is transformed in As3. The C library has to be without bugs, when I transform it in Swf ? Thank you, Christophe,