How about you, the personalization feature in reading a csv file?

I want to know about the personalization feature and how to implement it in j2me blackberry for reading a csv file

So guys someone help me about this

It is a code that I found somewhere that will provide this type of functionality.

It uses % and $ to indicate where substitutions must go, and the number between the two is used as the index in the array of strings that you provide as the second parameter.

I suspect that you can adapt it to your needs.

As Simon points out, it's really just a problem of standard Java, and you will be able to find solutions to these kinds of things looking around the Internet rather than here, where our attention is BlackBerry Java.    in fact, I think I found this code somewhere on the Net.

        private final static char LEFT_INDICATOR = '%';
        private final static char RIGHT_INDICATOR = '$';

        /**
        * Replace placeholders in template with parameters.
        *
        * @param message  the template with placeholders
        * @param params   array of parameters
        * @return         buffer containing formatted message
        */
        public static String formatMessage(String message, String[] params) {
                if (message == null || message.length() < 1 || params == null || params.length < 1 ) {
                        throw new NullPointerException("formatMessage Template or parameter array is null or empty.");
                }
                boolean inside = false;
                boolean escaped = false;
                StringBuffer result = new StringBuffer();
                StringBuffer placeholder = null;
                char lookingFor = LEFT_INDICATOR;
                char c;

                for (int i = 0; i < message.length(); i++) {
                        c = message.charAt(i);
                        if (c == lookingFor) {
                                if (escaped) {
                                        result.append(c);
                                        escaped = false;
                                        continue;
                                }
                                if (c == LEFT_INDICATOR) {
                                        // look ahead for escaped indicator
                                        if ((i + 1) < message.length() &&
                                                message.charAt(i + 1) == LEFT_INDICATOR) {
                                                escaped = true;
                                        } else {
                                                inside = true;
                                                lookingFor = RIGHT_INDICATOR;
                                                placeholder = new StringBuffer();
                                        }
                                } else {
                                        inside = false;
                                        lookingFor = LEFT_INDICATOR;
                                        // placeholder finished get parameter
                                        int index = -1;
                                        try {
                                                index = Integer.parseInt(placeholder.toString());
                                                result.append(params[index-1]);
                                        } catch (Throwable t) {
                                                result.append(Characters.EM_DASH); // Something
                                                t.printStackTrace();
                                                LibraryRepository.logEventError("Format Error for:" + message +
                                                        ", placeholder: " + placeholder.toString() + ", parm #:" + params.length);
                                        }
                                }
                        } else {
                                if (inside) {
                                        placeholder.append(c);
                                } else {
                                        result.append(c);
                                }
                        }
                }
                // for
                return result.toString();
        }

Tags: BlackBerry Developers

Similar Questions

  • How to enable the ReadyBoost feature?

    I would like to know how to enable the ReadyBoost feature.

    Does anyone have any suggestions?
    Thanks in advance for your suggestions

    I would like to know if it is possible to assign an SSD internal to do this instead of using a USB drive or not.  I tried ReadyBoost option in SSD drive is not available.

    Do you have any suggestions?
    Thanks a lot for your suggestions :>

    Hello

    Sorry, but you cannot use an internal hard drive for ReadyBoost. Indeed, an SSD can not use ReadyBoost.

    This feature can use a USB flash drive external as a hard drive cache to improve the disk read performance.

    More information on the following links.

    Understand the ReadyBoost and the question of whether it will Speed Up your system
    http://TechNet.Microsoft.com/en-us/magazine/ff356869.aspx

    Turn ReadyBoost on or off a storage device:
    http://Windows.Microsoft.com/en-us/Windows7/turn-ReadyBoost-on-or-off-for-a-storage-device

    Concerning

  • How "reverse you" the effects of the dynamics of transformation of fm records

    I found a box of tapes of audio recordings of the concert FM since the 1970s and 80s I want to capture and rework for my collection.

    How "reverse you" the effects of the dynamics of transformation of the fm recordings.

    Are there plugins at the hearing. Please tell us which one is best and he offered to help me get started.

    If this is not the case in hearing is there other software out there that would be good to use.

    Thank you

    Rick

    I fear for all purposes, you can't do that - it always makes things worse.

    The problem is that you have no idea of the time constants of compression or amounts used, and without this information, everything you do will bring another change to the dynamics, but won't cancel everything that happened before, because it will be the exact opposite. Processes such as Dolby, even if the amounts are specified, are equally difficult to decode simply because nobody never provided for in reference levels (except professional stuff, like Dolby A), therefore, generally, people simply don't and just swallow the BF a little depending on their ears.

    Even if they could have done (possibly at an advantage...), Dolby has never authorized anyone to produce a Dolby B reading filter and forbade indeed expressly probably because they know that it will do more damage that would prevent ever, just because of differences in level and the weird effects they may cause with an incorrect decoding.

    So I'm afraid that we cannot help you with this, other than to say 'let alone '. Even if you know what was the encoding process, then it will always be difficult to decode, simply because of the issue of levels.

  • How to disable the search feature in inputComboboxListOfValues

    Hello

    I'm working on Jdeveloper version 11.1.1.6.0. I use the component 'inputComboboxListOfValues '.

    How to disable the search feature in inputComboboxListOfValues?

    Frank Nimphius-Oracle

    I saw a topic archived for even where you replied on

    AF | {inputComboboxListOfValues::search}

    visibility: hidden

    }


    But when I use it, I'm getting some unknown pseudo class look in the css source file while pasting your code.

    Pls help.


    Thank you

    Hey, Timo,.

    Found the solution,

    LOV > UI advice > list Searh > include the search box > select No research

    Search link will be disabled in the drop-down list box drop-down list

    Thank you

  • How reset you the app to drive zero when you have completed a workout?

    How reset you the app to drive zero when you have completed a workout?

    Hi Larry

    When you are ready to complete your workout, press firmly on the view > press end > turn the digital Crown to scroll the summary results > at the bottom of the summary, touch save or delete.

    More information:

    Use of the workout on your Apple Watch - Apple Support

  • How set you the sensitivity of the keyboard on a touchsmart quad 17 t enyv

    How set you the sensitivity of the keyboard on a touchsmart quad 17 t enyv

    Keyboard:

    http://support.HP.com/us-en/document/c03738933

  • How defragment you the MFT in Windows 7?

    Original title: ' Defrag MFT '

    How defragment you the MFT in Windows 7?

    Hello

    Are you facing any kind of issues related to the master file Table?
    Defragmenting your hard drive should take care of the MFT also. The defrag engine and experience in Windows 7 has been reorganized based on the analysis of continuous and comprehensive impact on the responsiveness of the system.

    Thanks and greetings
    Umesh P - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • How uncheck you the option buttons in Adobe Acrobat Pro XI?

    How uncheck you the option buttons in Adobe Acrobat Pro XI?

    OK, so I have a three sets of radio buttons each three choices, so, basically, it looks like this

    Cheques:          (    )          (     )          (     )

    Deposit slips: () ())

    Envelopes:        (    )          (     )          (     )

    In case anyone is confused, () are radio buttons. Basically, I want radio buttons to act as check boxes, I want to be able to click them and outside. I don't want us boxes because I want them to be circles and not square. Is there a way to do this? Maybe using javascript, what code would be?

    Radio button names: QTY.

    XQTY

    XPrice

    Thanks in advance guys

    You don't have to use a script. I rarely use the option button because they cannot normally be deselected once in the Group has been selected, but here's a backdoor method I use in the mouse event to the top:

    Uncheck the box if the SHIFT key is pressed while clicking on

    If (event.shift) event.target.value = "Off";

    The user will know that it is available. You can also configure a button that resets the value of the button to "Off".

    Another option is to add another choice, as "not applicable".

  • How display you the type of file in PS Elements 10?

    How display you the type of file in PS 10 items in the organizer for each photo?

    I know that you can right click and watch meta data.

    In PSE 7 it was displayed under each photo.

    Two things:

    1. set the display option to display file names:

    2. make sure your tiles are large enough to display the data:

    Ken

  • How to use the Group feature in insert or update

    Hai All

    How to use the Group feature in insert or update statement

    I'm generating attendance so I have a different set of timing example

    0800,1200,1230, 1700 and I need to insert data into the table that contains the intimate value min and max value for

    outtime and othere to inertval time in or out

    Pls tell me with some examples


    For example

    For INSERT

    Insert into T2 (barcode, empcode, respondent, attend_date)
    values (R2.cardn, R2.enpno, min(R2.) PtIMe), R2.pdate);


    Update

    Update dail_att set outtime = MAX (r2.ptime) where empcode = r2.enpno and barcode = r2.cardn and
    attend_date = r2.pdate;


    Here, in the place where I used to have so pls tell how to use

    Thanks and greetings

    Srikkanth.M

    Hi Srikkanth.M

    to insert:

    insert into test (dummy) values ((select max (dummy) to double));

    Update:

    Update test dummy value = (select max (dummy) to double where to test them. XXXXField = double. XXXXField);

  • What is the best way to read this binary file?

    I wrote a program that acquires data from a card DAQmx and he writes on a binary file (attached file and photo). The data I'm acquisition comes 2.5ms, 8-channel / s for at least 5 seconds. What is the best way to read this binary file, knowing that:

    -I'll need it also on the graphic (after acquisition)

    -J' I need also to see these values and use them later in Matlab.

    I tried the 'chain of array to worksheet', but LabView goes out of memory (even if I don't use all 8 channels, but only 1).

    LabView 8.6

    I think that access to data is just as fast, what happens to a TDMS file which is an index generated in the TDMS file that says 'the byte positions xxxx data written yyyy' which is the only overload for TDMS files as far as I know.

    We never had issues with data storage. Data acquisition, analysis and storage with > 500 kech. / s, the questions you get are normally most of the time a result of bad programming styles.

    Tone

  • How 2 change the name of image, including its .xmp file?

    How 2 change the name of image, including its .xmp file?

    I suppose that if I change image file name, the file '.xmp' that accompanies it will no longer an appropriate reference to associate. Also, I guess I can just simply change the name of the image file and give its eponymous .xmp. That means, for example, if I have:

    "This1stPhotoOfJane.dng" and "This1stPhotoOfJane.xmp"

    and change their names manually:

    "JanePhoto1.dng" and "JanePhoto1.xmp"

    It would not work.

    So is the simple way to do it?

    I have a bunch of files that I forgot to name who have already gone through the raw editor and now I would like to give them a real name as opposed to a single series of numbers they currently have.

    You should be able to bridge, since by default, the file of the side car is hidden. I think he knows enough to rename both.

    Copy the image and the file in a temporary folder, rename it and check that it actually did. If I myself remember copy or film a raw file would also move or copy the file, then it would be a good time to check that as well.

  • How to export the same MB size of my cr2 files in jpg or tiff files in Lr?

    How to export the same MB size of my cr2 files in jpg or tiff files in Lr?

    Let's say that my height is 22 MB, when I export the file in TIFF or jpg, although careful Iam with size of file settings, size, resolution, I can't manioukate how I want it.

    With jpg I tried everything, no matter what I do or a change in file size or meanless remains the same size - 7 mb instead of 22...

    Please advise,

    Best wishes

    T

    You should not even try to do it.

    JPG uses compression technology, so the files will have to be smaller than the original size of your RAWs. In addition, JPGs are 8-bit, while your RAWs are probably 14 bits, so the size needed to store your image will be smaller.

    Thus, there is absolutely nothing wrong with getting a 7 mb JPG of a 22 MB RAW.

  • How can I convert a PDF to xls or csv file

    How can I convert a PDF to xls or csv file? thnx

    HI newapiary

    You can either use Adobe Acrobat or Adobe ExportPDF Service online.

    Please visit: https://www.acrobat.com/exportpdf/en_GB/convert-pdf-to-word.html

  • How stop you the opening page features of Mozilla?

    im getting really upset not being able to stop the 2 pages open when I click on my firefox browser. a page that I want to open is my page of yahoo.com , the other is your new mozilla Add ons page. its boring and im about to stop using Mozilaa because of this. its ridiculous that we can stop him to load everytime I open my browser. Ive tried many things to stop it. Please help and thank you for your time

    Kevin

    Do you mean the page modules ordinary (the one that opens when you press Ctrl + Shift + a) or a page for a specific module?

    You get the unwanted page when you launch a new window (Ctrl + n)?

    If so, which may indicate:

    • One of your modules displays the new page.

    If the extra page does NOT appear in a new window, could test you using your Firefox desktop icon a second time without closing Firefox? This should launch a new window.

    If THE new window has the unwanted page, your shortcut of Firefox can be hacked. You can check by right clicking it > properties > Shortcut tab. The goal for 64-bit Windows 7 should be either not less the following:

    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
    

    If THE new window does NOT have the unwanted page, Firefox may show a 'one time' page and failing to mention that he showed on the page, so it keeps only once the action at every start. Have you noticed Firefox remember other changes of parameters of the problems? This article has a range of suggestions to address this kind of issue: How to fix preferences that will not save.

Maybe you are looking for