How can I use script change long list format?

Hi everyone
If I have this kind of long list
0101
Long white radish
Chinese Celery
Tah tsai
Round cucumber
Cherry radish
fennel
Small-leaf arugula
Small wax gourd
0102
Green-leaf Lettuce
Broad-leaf arugula
UFO squash
Crystal radish
Red wave lettuce
Green endive
Sponge gourd
Rose-heart radish
Butter head lettuce
Radicchio
0103
Chinese mustard
New Zealand spinach
Yellow summer squash
Turnip
Malabar spinach
Chinese kale
Green bean
Edible rape
Begonia fimbristipulata hance
Purple bean
Cabbage
Water Spinach
Okra
Snow peas
How can I change the format into this:
0101
0101/Long white radish
0101/Chinese Celery
0101/Tah tsai
0101/Round cucumber
0101/Cherry radish
0101/fennel
0101/Small-leaf arugula
0101/Small wax gourd
0102
0102/Green-leaf Lettuce
0102/Broad-leaf arugula
0102/UFO squash
0102/Crystal radish
0102/Red wave lettuce
0102/Green endive
0102/Sponge gourd
0102/Rose-heart radish
0102/Butter head lettuce
0102/Radicchio
0103
0103/Chinese mustard
0103/New Zealand spinach
0103/Yellow summer squash
0103/Turnip
0103/Malabar spinach
0103/Chinese kale
0103/Green bean
0103/Edible rape
0103/Begonia fimbristipulata hance
0103/Purple bean
0103/Cabbage
0103/Water Spinach
0103/Okra
0103/Snow peas
by useing script?
thanks
Teetan

Hi,
Perhaps not a problem, try this code ...
var myFolder=Folder("~/Documents");
var sourceFile = new File(myFolder + "/"+"sourceFile.txt");
var logFile = new File(myFolder + "/"+"logFile.txt");
//var elementList = Array('0101','Long white radish','Chinese Celery','Tah tsai','Round cucumber','Cherry radish','fennel','Small-leaf arugula','Small wax gourd','0102','Green-leaf Lettuce','Broad-leaf arugula','UFO squash','Crystal radish','Red wave lettuce','Green endive','Sponge gourd','Rose-heart radish','Butter head lettuce','Radicchio','0103','Chinese mustard','New Zealand spinach','Yellow summer squash','Turnip','Malabar spinach','Chinese kale','Green bean','Edible rape','Begonia fimbristipulata hance','Purple bean','Cabbage','Water Spinach','Okra','Snow peas')
//var newElementList = new Array;
var myPattern = new RegExp("^\\d{4,4}$");
var myPrefix="";
if (sourceFile.exists){sourceFile.open( 'r' );
while( !sourceFile.eof ) {
          var aElement  = sourceFile.readln();
          if (myPattern.test(aElement)){
              //newElementList.push(aElement);
              myPrefix = aElement + "/";
              writeLogFile(aElement)
          } else {
               //newElementList.push(myPrefix+ aElement);
               writeLogFile(myPrefix+ aElement)
    //$.write(newElementList);
function writeLogFile(theString) {
    logFile.open( "a" );
    logFile.writeln(theString);
    logFile.close();   

Similar Messages

  • How can I use two drop down lists for one time value?

    I want to enter the length of time that someone does an activity in hours and minutes using two drop down lists, then enter them as a single time value (H:i:s) in Mysql.
    I've used the basic drop down lists, and a few different variations of the following with no success (seconds is a hidden field with a value of "00"):
                           GetSQLValueString(strftime('%H:%i:%s', strtotime($_POST["sleeptimemin"]." ".$_POST["sleeptimehr"]." ".$_POST["seconds"])), "date"),
    This returns 00:00:16, no matter what is selected on the drop down list.
    Any help would be appreciated.

    MySQL stores times in human-understandable format, using the 24-hour clock.
    GetSQLValueString($_POST['sleeptimehr'] . ':' . $_POST['sleeptimemin'] . ':00', "date"),

  • How can I use the MPEG-2 DVD format for video rendering?

    I have been trying to make a DVD out of my brother's wedding footage, but I've run into a wall. I would like to render out my footage in the .M2V format (MPEG-2 DVD), but I'm not given the option to use it. The only MPEG format I'm given is the .H264, and that doesn't work as well. How can I install the .M2V codec?

    You should either:
    Render to a suitable production codec and then compress for DVD in your authoring application.Use the Render Cue to render a PhotoJpg at NTSC or PAL file using default frame sizes for your AE rendering composition, then drop in Encore for authoring.
    Open your AE project in Adobe Media Encoder, pick the composition you want to render from the list and pick the MPEG 2 for DVD preset.
    Open Adobe Encore, select File>Dynamic Link>Import After Effects Composition and then set up your timelines and menu's as you like and select Build DVD.
    All DVD authoring programs will compress standard def video in just about any format for DVD. After Effects, however, will not do multi-pass rendering which is required for high quality MPEG compression.

  • How can I use the call's list?

    Dear friends,
    I have some problems with a call I received and with my boss.
    On my Iphone 4S I can see the list of the last calls. Let's say that I have a 45minutes incoming call from my friend. Looking the detail by the arrow, on the right, I can see also other information, like the complete number and the lenght of the call (45 min, in this case).
    Now the point: someone heard me during the call and said I got that phone call form someone else!
    I replied that is not possible: you can modify the name of the contact, in this case it seems that I got the call from the new name, but I also showed that if you modify the number too (yes, it's possible) the call disappears from the call list!
    Now I have the complete call list and I can show that the "trick" is not possible, but they don't believe me and, since the question is quite important, I'm risking to loose my job.
    Can someone give me the confirmation that is not possible to do this? I mean, I want to be sure of my theory that no one can change name and number of the call and keep the call amongst all the other calls...
    Many thanks in advance for your help!
    Mark

    You cannot use your iPhone as a normal storage system. The only way to get documents and other stuff on it is to sync via iTunes (unless you use an app like evernote, which has its own sync).

  • How can i use LINK_CLICK event

    Hi,
    how can i use event LINK_CLICK in list tree.
    Plz help me.
    Regards ,
    Venkat.

    use this....
    CLASS cl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS on_expand_no_children
                FOR EVENT expand_no_children OF cl_gui_simple_tree
                IMPORTING node_key sender.
        METHODS on_node_double_click
                FOR EVENT node_double_click OF cl_gui_simple_tree
                IMPORTING node_key sender.
    ENDCLASS.
    CLASS    cl_event_receiver
    IMPLEMENTATION
    CLASS cl_event_receiver IMPLEMENTATION.
    Triggering event:      expand_no_children
    Handling method:       on_expand_no_children
    Description:
    The handling method is called whenever a node is supposed to be
    expanded (by clicking on the expander icon) while subordinate entries
    are not yet known in the GUI.
    In this case the node table must be complemented with the respective
    entries.
      METHOD on_expand_no_children.
        IF SENDER <> obj_simple_tree.
          EXIT.
        ENDIF.
    Determine subnodes
        REFRESH t_gui_node.
        LOOP AT t_node INTO wa_node WHERE relatkey = node_key.
          APPEND wa_node TO t_gui_node.
        ENDLOOP.
    Send node table to GUI
        CALL METHOD obj_simple_tree->ADD_NODES
          EXPORTING
            TABLE_STRUCTURE_NAME           = 'MTREESNODE'
            NODE_TABLE                     = t_gui_node
          EXCEPTIONS
            ERROR_IN_NODE_TABLE            = 1
            FAILED                         = 2
            DP_ERROR                       = 3
            TABLE_STRUCTURE_NAME_NOT_FOUND = 4
            others                         = 5.
        IF SY-SUBRC <> 0.
          MESSAGE i398(00) WITH 'Error' sy-subrc
                                'at methode ADD_NODES'.
        ENDIF.
      ENDMETHOD.
    Triggering event:      node_double_click
    Handling method:       on_node_double_click
    The handling method is called every time a double-click is executed
    on a node or a leaf.
      METHOD on_node_double_click.
        IF SENDER <> obj_simple_tree.
          EXIT.
        ENDIF.
    Output message for selected node or leaf
        CLEAR wa_node.
        READ TABLE t_node
          WITH KEY node_key = node_key
          INTO wa_node.
        IF SY-SUBRC = 0.
          IF wa_node-isfolder = 'X'.
            MESSAGE i398(00)
              WITH 'Double-click on node' wa_node-node_key.
          ELSE.
            MESSAGE i398(00)
              WITH 'Double-click on leaf' wa_node-node_key.
          ENDIF.
        ELSE.
          MESSAGE i398(00)
             WITH 'Double-click on unknown node'.
        ENDIF.
      Trigger PAI and transfer function code (system event)
        CALL METHOD cl_gui_cfw=>set_new_ok_code
             EXPORTING new_code = 'FCODE_DOUBLECLICK'.
      ENDMETHOD.
    ENDCLASS.
    *&      Module  STATUS_0100  OUTPUT
          GUI status for dynpro
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'DYN_0100'.
      SET TITLEBAR 'DYN_0100'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  create_objects  OUTPUT
          Create instances
    MODULE create_objects OUTPUT.
      IF NOT obj_custom_container IS INITIAL.
        EXIT.
      ENDIF.
          Create instance for custom container
      CREATE OBJECT obj_custom_container
        EXPORTING
        PARENT                      =
          CONTAINER_NAME              = 'DYNPRO_CONTAINER'
        STYLE                       =
        LIFETIME                    = lifetime_default
        REPID                       =
        DYNNR                       =
        NO_AUTODEF_PROGID_DYNNR     =
        EXCEPTIONS
          CNTL_ERROR                  = 1
          CNTL_SYSTEM_ERROR           = 2
          CREATE_ERROR                = 3
          LIFETIME_ERROR              = 4
          LIFETIME_DYNPRO_DYNPRO_LINK = 5
          others                      = 6.
      IF SY-SUBRC <> 0.
        MESSAGE i398(00) WITH 'Error' sy-subrc
                              'when creating the custom container controls'.
      ENDIF.
          Create instance (back-end) for Simple Tree Model
      CREATE OBJECT obj_simple_tree
        EXPORTING
          NODE_SELECTION_MODE = CL_SIMPLE_TREE_MODEL=>NODE_SEL_MODE_SINGLE
        HIDE_SELECTION              =
        EXCEPTIONS
          ILLEGAL_NODE_SELECTION_MODE = 1
          others                      = 2.
      IF SY-SUBRC <> 0.
        MESSAGE i398(00) WITH 'Error' sy-subrc
                              'when creating the Simple Tree Model'.
      ENDIF.
          Create instance (representative object for control at front end)
      CALL METHOD obj_simple_tree->CREATE_TREE_CONTROL
        EXPORTING
        LIFETIME                     =
          PARENT                       = obj_custom_container
        SHELLSTYLE                   =
      IMPORTING
        CONTROL                      =
        EXCEPTIONS
          LIFETIME_ERROR               = 1
          CNTL_SYSTEM_ERROR            = 2
          CREATE_ERROR                 = 3
          FAILED                       = 4
          TREE_CONTROL_ALREADY_CREATED = 5
          others                       = 6.
      IF SY-SUBRC <> 0.
        MESSAGE i398(00) WITH 'Error' sy-subrc
                              'when creating the Simple Tree Control'.
      ENDIF.
    ENDMODULE.                 " create_objects  OUTPUT
    *&      Module  register_events  OUTPUT
          Event handling
    MODULE register_events OUTPUT.
          Register events as system event at CFW                         *
      CLEAR t_events.
    Register event for double-click
      CLEAR wa_event.
      wa_event-eventid = CL_SIMPLE_TREE_MODEL=>EVENTID_NODE_DOUBLE_CLICK.
      wa_event-appl_event = ' '.
      APPEND wa_event TO t_events.
    Register events at CFW and control at front end
      CALL METHOD obj_simple_tree->SET_REGISTERED_EVENTS
         EXPORTING
            EVENTS                   = t_events
         EXCEPTIONS
           ILLEGAL_EVENT_COMBINATION = 1
           UNKNOWN_EVENT             = 2
           others                    = 3.
      IF SY-SUBRC <> 0.
        MESSAGE i398(00) WITH 'Error' sy-subrc
                              'when registering the events'.
      ENDIF.
          Create event handler and register events
      IF obj_event_receiver IS INITIAL.
        CREATE OBJECT obj_event_receiver.
        SET HANDLER obj_event_receiver->on_node_double_click
                FOR obj_simple_tree.
        SET HANDLER obj_event_receiver->on_expand_no_children
                FOR obj_simple_tree.
      ENDIF.
    ENDMODULE.                 " register_events  OUTPUT
    *&      Module  create_tree  OUTPUT
          Create node table with root and 1st level
    MODULE create_tree OUTPUT.
      IF NOT t_node IS INITIAL.
        EXIT.
      ENDIF.
          Create node table
      PERFORM fill_node_table.
          Fill node table t_gui_node for control
      REFRESH t_gui_node.
      t_gui_node = t_node.
          Transfer entire node table to Simple Tree Model
      CALL METHOD obj_simple_tree->ADD_NODES
        EXPORTING
          NODE_TABLE          = t_gui_node
        EXCEPTIONS
          ERROR_IN_NODE_TABLE = 1
          others              = 2.
      IF SY-SUBRC <> 0.
        MESSAGE i398(00) WITH 'Error' sy-subrc
                              'at methode ADD_NODES'.
      ENDIF.
    ENDMODULE.                 " create_tree  OUTPUT

  • How can I use a downloaded song as an alarm on my timer? Not a ringtone, a song. It is only 30 sec. long.

    How can I use a downloaded song as an alarm on my timer? Not a ringtone, a song. It is only 30 sec. long.

    This is not particularly helpful. I've looked on 3 websites and none of them match my configuration of iTunes. I've gotten as far as creating an AAC file and that is it. Can't find the .m4s designation to change it.

  • How can I use srvctl command line for change "Failover type" and "F method"

    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.

    user10674190 wrote:
    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.srvctl modify service -d database_name -s orcldb -q TRUE -m BASIC -P BASIC -e SELECT -z 180 -w 5 -j LONG
    Also see
    11gR2(11.2) RAC TAF Configuration for Admin and Policy Managed Databases [ID 1312749.1]

  • How can I broadcast a changed email address to my contacts list

    how can I broadcast a changed email address to my contacts list?

    There is one thing to be careful about though when using the "Send Updates" feature in Address book to notify your contacts about address/contact info changes. 
    Addressbook will automatically include your personal vCard at the end of the email message that goes out to your list.  I did not realize this at the time and it royally burned me.  My default address card had a lot of extra personal information contained within it that I did not want people to see.  There was no indication that the vCard would automatically be included nor any way to disable this feature just before sending the "update" email.  As a result, my list received my private information and the only thing I could do was to send a new email to the list manually, minus the vCard attachment, requesting that they please delete the first email in favor of this new one.  I'm hoping that most will disregard the vCard, though I fear the damage has been done.
    I later discovered that the preferences now include a checkbox for enabling/disabling a "private me card", which allows you to control which content is included in your vCard information.  This is handy now, but I wished the default had been to have vCards turned off / not included automatically, since it was a feature I didn't discover until AFTER my updates had been sent! 
    Running OS 10.7.5

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • How can I use same account in 2 iphone with diff contact list?

    how can I use same account number but other all totally diff such as contact list, application, everything ..... I found that it's bad on IOS5.
    when I used IOS4 .. old verison, I can keep my phone in diff data. Afte upgrade IOS 5, it's bad. Even take photo, it can not focus zoom in and out.

    how can I use same account number but other all totally diff such as contact list, application, everything ..... I found that it's bad on IOS5.
    when I used IOS4 .. old verison, I can keep my phone in diff data. Afte upgrade IOS 5, it's bad. Even take photo, it can not focus zoom in and out.

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How can I use iCloud-keychain if i can not find my country in the country code list?

    How can I use iCloud-keychain if i can not find my country in the country code list?

    Welcome to the Apple Community.
    If your country code does not appear in the list…
    Go to System Preferences > iCloud > Keychain and enter your Apple ID password (Settings > iCloud > Keychain, from a mobile device)
    Select the ‘Create Different Code’ option. (Mobile devices only)
    Select the advanced option and choose whether to create a random code or no code, selecting the later allows syncing across devices but not with Apple’s servers.

  • How can I use comma in the return values of a static list of values

    Hi all,
    I want to create a select list (static LOV) like the following:
    Display Value / Return Value
    both are "Y" / 'YY'
    one is "Y" / 'YN','NY'
    I write the List of values definition is like this:
    STATIC:both are "Y"; 'YY',one is "Y";'YN', 'NY'
    However, it is explain by htmldb like this:
    Display Value / Return Value
    both are "Y" / 'YY'
    one is "Y" / 'YN'
    / 'NY'
    I tried using "\" before the ",", or using single or double quote, but all these do not work:(
    How can I use a comma in the return values?
    Thanks very much!

    "Better still, why not process the code of both Y with 2Y and one is Y with 1Y? "
    Could you please explain in detail? thanks! I am quite new to htmldb
    In fact I have a table which has too columns "a1" and "a2", both the values of these two columns are "Y" or "N". AndI want to choose the records that both a1 and a2 are "Y", or just one of a1, a2 is "Y".
    So I write the report sql like this:
    "select * from t1 where a1 || a2 in(:MYSELECTLIST) "
    Thus, I need to use "," in the LOV, since expression list in IN(,,,) using ",".
    Any other way to implement this?

  • How many lines we can print using Non-alv report list ?

    Hi Experts,
    How many lines we can print using Non-alv report list ?
    regards
    vishnu

    Hi,
    It depends on the page size according to the page size we can set the no. of lines as follows,
    REPORT  program_name   NO STANDARD PAGE HEADING
    LINE-SIZE 290
    LINE-COUNT 65.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • How can i use dsadm to change the ldap port?

    I have a ldap with port 1389,I changed it to 389,now I can not start it because it is a non root user.
    Now I want to change the port back to 1389,but I can not use dsconf because the server is not running.
    How can i do now? How can i use dsadm to change the port?
    Thank u very much.

    My apologies, I didn't mean to be rude/impolite.
    I just wanted to emphasize that in a situation where a Directory Server doesn't even start, you cannot interact with the live server to configure the new port (either talking LDAP or otherwise). All you can do in that case won't be related with the LDAP (that's just the name of the protocol): either assigning network privileges to the user, or changing the Directory Server configuration file.
    The other thing I'd like to outline (and this could take a separate thread ;-) ), is that semantically, I'd prefer talking of a Directory Server instead of an LDAP Server because the former is 'something' providing Directory Services, whereas the latter is just the name of the protocol we use to interact with the server; but this is just my personal opinion, you don't have to agree with me.
    that's all folks!
    marco

Maybe you are looking for

  • Viewing Chinese Character in browsers?

    Hi all, I am interested to create a plug-in or application to allow a browser to view Chinese characters. anyone has any experience in this area? If you knwo any useful sites on this pls do tell me also. A million thanks. KS Lee

  • Planning for Components to be Provided in Subcontracting

    Hi all, May I know what is the business rational to plan the requirements to be provided for the components (material provide to vendor) for one subcontractor separately from all other requirements with the use of MRP area (i.e. what is the business

  • IDVD not able to start DVD magic

    IDVD application quits everytime when trying to create project....Not sure what is teh issue here Mahesh

  • MBP - Too Long doing DNS lookups?

    I've noticed that my brand-new MBP seems to take an excessively long time to do DNS lookups. I'll load Firefox and type in google.com in the URL bar. In the status bar below it will say "looking up google.com" for at least 10 seconds. Meanwhile, I've

  • Hardware NLB Webcache and SSL

    Hi, I've configured Webcache 10.1 with iAS R1 mid tiers with SSL and all is fine. A new requirement is to front this setup with two Cisco NLB's on a common domain name and ip address. If I need to configure the NLB's with an SSL sticky connection to