String parsing - better solution needed :-(

Hi Folks,
Basically I will be taking in a string that represents the name of the output file the user wants, this will be specified in an xml file. The issue I have is that it needs to have non-static elements as part of the name as well (like a timestamp). This can come from two places: 1) the applications map 2)Predefined list of functions. Anything that will be comng from the map will have square brackets around it [], whilst anything the refers to a function will be inside curly brackets {}.
So I may get a string in the form: filename_[user.id]_{datestamp}.pdf
This should be output in a file called: filename_12345_2811208.pdf
My issue is with evaluating the string, to determine what needs to be left as is, replaced with a value from a function, or replaced with a value from the map. I have looked at tokenizing the string and using indexof, but these are more trouble than they are worth. My current solution is, to have 4 booleans- one representing an open and close bracket of each type. When two matching booleans are true (i.e. detected an open and closed square bracket) take the sub-string between the brackets (to do this I use two ints representing the index of the brackets), evaluate it and append it to the output string.
I have tested this and it works- but I was wondering if there is some other method that works better, as quite frankly my solution is the sort of embarassing crud you would see from a first year student programmer. Any help at all would be massively appreciated.
Cheers,
Max

Hi swmtgoet_x,
Thanks for the speedy reply- and your understanding of the problem is spot on.
I had looked at the replace method- the only issue with that is that I have no way of knowing which value the users will want from the map (depending on how they have it implemented there could be hundreds of things in there), so to search the string for any value in the map would be hugely ineffecient :-(
But having said that- I could look at using that approach for "pre-defined function"- I don't think there will be many of these, but in typical fashion no one has seen fit to gove me a list yet.....so I get to guess. :-s

Similar Messages

  • A better solution needed

    Adobe added a bug in the latest version of Premiere Pro that affect MXF files. The bug causes weird things on my current projets and makes my projets created on earliest versions of PP unasable. Support told me to roll back too 7.0.0 to work on those projects. However, the old version is not compatible with my new projects. The solution provided by support: uninstall and reinstall the correct version according to the project I'm working on. Several times a day as needed.
    I would be interested by alternative solutions as I don't want the close my business because I cannot deliver on time.

    Support told me that they are aware of this problem and that they are working on it for the next upgrade. The problem is to complicated to explain, I just mess-up the MXF clips in different ways depending on the projets. For exemple, I can have 6 different MXF clips showing me the same thing in Premiere (but not in "real life"). But support used my computer for countless hours to study the problem. Maybe you can check with them?

  • Need better solution than FCPX for audio cleaning

    Hi, I have a track for a wedding with a lot of background noise. The settings to improve audio on FCPX are not helping much. What's the bets solution to improve voice and reduce background noise?
    Thanks

    If Audacity or STP don't handle it for you, seriously consider giving ScreenFlow a try. ScreenFlow has about the best noise reduction I've ever heard from any app I've ever used. You can load the audio (or video+audio) up in SF (create a New Document from the File menu), drag and drop your media into the Media panel, then drag it to the timeline; select the audio track, go to the audio panel (speaker icon) and select: Filter: Remove Background Noise (accept the default setting of 80%) -- that's usually all there is to it!  There's a free trial available (http://www.telestream.net/screenflow/overview.htm) — it's fully functional except that it watermarks the video output. It will export AIFF audio (LinearPCM 48kHz) and you can export audio only.

  • Third party PO Process -Looking for better solutions

    what would be best solution for the below business process
    We have one corporate headquarters(A) which has 3 plants(Plants X,Y and Z).
    Corp.HQ (A) deals negotiation with one supplier directly and buys the materials and responsible for the payment.
    but the goods should be directly delivered to the plants ...not to Corp.HQ
    At the same time the receiving plants,intern have to pay to the corp.HQ for the same.
    I can think of 2 step process for this process
    Step 1 : Creating Third party PO between Corp.HQ and Supplier
    Step 2 : Creating a Stock transport order /Intercomp order between Corp.HQ and receiving plants
    But is there any solution with Single step or any other better solution for this process?
    Thanks in advance
    Thanks and Regards,
    Kesavan

    The first step is not ok in my opinion, since the goods will be posted for consumption, so there will be no stock to be transferred via the intercompany STO (2nd step in your process).
    In SAP it is possible to use central purchasing organisation. What if the HQ would be represented in the purchasing process as a central purch. org. and it would issue a "normal" PO to the vendor (one PO: vendor --> manufacturing plant)?
    In this case you should solve the payment process only (HQ --> vendor; plant --> HQ) - if the HQ would be set as invoicing party in the PO, the payment between HQ and plant would be solved. In the vendor's SO the HQ should be set as payer/invoicing address, the HQ would receive the invoice and eneter it w/o any PO (but enter the real PO number as reference).
    You would need some development to integrate the two incoming invoices not to have discrepancy.
    Just an idea...

  • I want better solution for adjusting the Material stock values for the last

    my Customer  need to adjust( Decrease)  the closing stock values for the following materials / plant wise as on 31.03.2006 for meeting statuary compliance.
    Material1 :  RS: 4149599    QTY : 10181.03 Ltrs
    Material 2  : RS: 1318596     QTY:  2152.76   Ltrs
    As per my knowledge MM posting periods can open current month and Previous month only. For the reason I proposed the solution as follows:
    Step 1 : post FI Journal Entry on 31.03.2006
    Opening Balance G/L  Account Dr 4149599 + 1318596
    Closting Stock a/c                      Cr 4149599 + 1318596
    Step 2.
    Change the Material Price in MM through T.Code: MR21
    ( Posting will be allowed in current or previous months)
    This makes our CO reports accurate.
    Please  suggest the better solution if it is possible in MM for adjusting the Material stock values for the last financial year.
    WIth Best Regards,
    Rajesh
    <b></b>

    Hi Madhavan,
    Unfortunately this forum deals with migrations from non-Oracle
    environments to Oracle. You seem to be dealing with migrations in
    an Oracle environment mainly.
    I would recommend that you contact Oracle Applications and RDBMS
    support directly. They will have the most up to date
    information/advice on performing these actions.
    Regards
    John
    Madhavan (guest) wrote:
    : Hi John
    : Thanks for your reply.
    : Actually I am planning to upgrade the system.
    : 1. I Want to Upgrade Oracle Financials release 10.7 to the
    : latest version (11.x)
    : 2. Oracle 7 database to oracle 8 or 8i.
    : 3. Oracle is running on NT service pack 3. Do I need to upgrade
    : this?. If not what is the impact on Windows NT?
    : 4. Is the majority still running smart client 10.7 and database
    : 7?
    : 5. What is the necessary time to implement these upgrades? What
    : type of consulting I need to have?
    : 6. I have some employees working on it? Will these changes
    : affect them?
    : What type of precautions I need to take on the whole??
    : Thank You
    : Madhavan
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Better solution than PARAM reset to keep Thunderbolt Port properly working.

    I have a MBP 17" (late 2011),
    To its Thunderbolt Port I have connected my Samsung T260 Display alternately with a KANEX 'Thunderbolt to eSATA/USB3.0' Adapter.
    But this always needs a PARAM reset after having the Display intermediately connected, else the ANKER 7xUSB3.0 Hub connected to the KANEX Adapter wouldn't be recognized correctly.
    Is there a better solution available for selective resetting the Thunderbolt Port, without restarting the system?
    Many Thanks for support.

    Update: I obtained a new replacement MiniDisplayPort-to-HDMI cable, and both displays are working fine now. However — and this is what's weird — the fix was not completely immediate! At first, all the resolution modes (including 1080p) began working again, but I was still seeing ghost images of moved or closed windows on the screen! After a day or so, those went away. What could possibly explain the temporary persistence of the ghost images even with a new cable?

  • MS IE toStaticHTML String Parsing Cross-Site Scripting Vulnerability alarms

    Hi,
    I was wondering if someone else has noted an increase in false positives concerning the following 2 events:
    - Microsoft Internet Explorer toStaticHTML String Parsing Cross-Site Scripting  Vulnerability
    - Microsoft Office Excel Ghost Record Parsing Arbitrary Code Execution Vulnerability
    Obvisouly I see these events because the signature has been introduced recently!!!
    But I wonder if these alarms I'm getting are genuine (and I have a big problem), or if the signature needs to be 'tuned' by Cisco to be a bit less sensitive?
    Anyone has experienced something similar or can shed a light?
    Thanks,
    seb.

    Hello Seb,
    Since I don't have the entire transmission, I can't tell what exactly is commented out in regard to the tags, but the data appears to look something like below.
    e){  
      //v3.0..   
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0;
    //-->
    @td  
    img{display: block;}
    @import url("p7tp/p7tp_01.css
    With 30419 being related to CVE-2010-3324, I assume the signature is firing due to some match variation of the fact that @import and the tags are showing up in a response from your web server. The toStaticHTML method should remove tags, but the vulnerability is causing that mechanism to fail.
    The oBot User-Agent caught my eye. Google returns several pages to the effect of oBot being a:
    "German spider from Cobion, now part of Internet Security Systems. Scans the web for their clients looking for copyright infringement."
    I'm not sure what benefit this search bot would receive from injecting Javascript into the response.
    I'll forward the capture data to our sig team to confirm whether this should be a legitimate match.
    Thank you,
    Blayne Dreier
    Cisco TAC Escalation Team
    **Please check out our Podcasts**
    TAC Security Show: http://www.cisco.com/go/tacsecuritypodcast
    TAC IPS Media Series: https://supportforums.cisco.com/community/netpro/security/intrusion-prevention?view=tags&tags=tac_ips_media_series

  • Help With String parsing

    Hey guys,
    I need some help with String Parsing. i hope experts here will help me.
    i'm reading a text file and getting data as String in this format
    *ABR, PAT MSSA        2009       7001    B   ABC       Y
    *VBR, SAT ZSSA        2008       5001    A   CED       N
    *ABC, AAT CSSA        5008       001     A   AZX       N
    *CBC, CAT FSSA        308        5001    A   XCV       N
    Now from following lines i have to extract Number data i.e. 2009 and 7001 from 1st line. 2008 and 5001 from 2nd line and so on.
    Can anyone pls suggest me any way to get the data that i want from these Strings
    Thanks for your time to read this.
    Regards,
    sam

    Thanks for the reply
    Data length can vary. ABR, PAT is the last name, First Name of the Users.
    it can be following or any other combination. i just need 2 set of numbers from the complete line rest i can ignore. Any other way to get that
    *ABRaaassd, PATfffff MSSA 2009 7001 B ABC Y
    *VBRaa, SATaa ZSSA 2008 5001 A CED N
    *ABC, AAT CSSA 5008 001 A AZX N
    *CBC, CAT FSSA 308 5001 A XCV N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I have a MacBook Pro 13.3 OS- MAC OS X LION.Whenever I am staring the computer, it says You need to restart your computer by pressing the power button.I did this number of times and everytime it freezes to the same screen.Solution needed urgently pls.

    I have a MacBook Pro 13.3 OS- MAC OS X LION.
    Whenever I am staring the computer, it says You need to restart your computer by pressing the power button.
    I did this number of times and everytime it freezes to the same screen.Solution needed urgently pls.
    Thank you for any help in this regard that comes fast.

    The details of the kernel-panic report is as follows-
    Interval Since Last Panic Report:  1458653 sec
    Panics Since Last Report:          6
    Anonymous UUID:                    70BA6A**************************************************
    Sun Sep 16 23:00:13 2012
    panic(cpu 0 caller 0xffffff80002c4794): Kernel trap at 0xffffff8000290560, type 14=page fault, registers:
    CR0: 0x0000000080010033, CR2: 0x0000000000800028, CR3: 0x000000000a509005, CR4: 0x00000000001606e0
    RAX: 0x0000000000000001, RBX: 0x0000000000820000, RCX: 0xffffff801122dc40, RDX: 0x0000000000020501
    RSP: 0xffffff80ef3d3da0, RBP: 0xffffff80ef3d3dc0, RSI: 0x000000002b1d78b6, RDI: 0xffffff800342d280
    R8:  0xffffff80ef3d3f08, R9:  0xffffff80ef3d3ef8, R10: 0x000000010d901000, R11: 0x0000000000000206
    R12: 0xffffff800342d280, R13: 0x0000000000000000, R14: 0xffffff8011cd6500, R15: 0x0000000000800000
    RFL: 0x0000000000010206, RIP: 0xffffff8000290560, CS:  0x0000000000000008, SS:  0x0000000000000000
    CR2: 0x0000000000800028, Error code: 0x0000000000000000, Faulting CPU: 0x0
    Backtrace (CPU 0), Frame : Return Address
    0xffffff80ef3d3a50 : 0xffffff8000220792
    0xffffff80ef3d3ad0 : 0xffffff80002c4794
    0xffffff80ef3d3c80 : 0xffffff80002da55d
    0xffffff80ef3d3ca0 : 0xffffff8000290560
    0xffffff80ef3d3dc0 : 0xffffff800026c9c3
    0xffffff80ef3d3f40 : 0xffffff80002c3fbb
    0xffffff80ef3d3fb0 : 0xffffff80002da481
    BSD process name corresponding to current thread: fsck_hfs
    Mac OS version:
    11E2620
    Kernel version:
    Darwin Kernel Version 11.4.2: Wed May 30 20:13:51 PDT 2012; root:xnu-1699.31.2~1/RELEASE_X86_64
    Kernel UUID: 25EC645A-8793-3201-8D0A-23EA280EC755
    System model name: MacBookPro9,2 (Mac-6F01561E16C75D06)
    System uptime in nanoseconds: 4850001132
    last loaded kext at 1796984176: com.apple.driver.BroadcomUSBBluetoothHCIController    4.0.7f2 (addr 0xffffff7f80e16000, size 57344)
    loaded kexts:
    com.apple.driver.BroadcomUSBBluetoothHCIController    4.0.7f2
    com.apple.driver.AppleUSBTCButtons    227.6
    com.apple.driver.AppleUSBTCKeyEventDriver    227.6
    com.apple.driver.AppleUSBTCKeyboard    227.6
    com.apple.driver.AppleIRController    312
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless    1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib    1.0.0d1
    com.apple.BootCache    33
    com.apple.iokit.SCSITaskUserClient    3.2.1
    com.apple.driver.XsanFilter    404
    com.apple.iokit.IOAHCISerialATAPI    2.0.3
    com.apple.iokit.IOAHCIBlockStorage    2.0.4
    com.apple.driver.AppleFWOHCI    4.8.9
    com.apple.driver.AirPort.Brcm4331    560.7.21
    com.apple.driver.AppleSDXC    1.2.2
    com.apple.driver.AppleUSBHub    5.0.8
    com.apple.iokit.AppleBCM5701Ethernet    3.2.4b8
    com.apple.driver.AppleEFINVRAM    1.6.1
    com.apple.driver.AppleSmartBatteryManager    161.0.0
    com.apple.driver.AppleAHCIPort    2.3.0
    com.apple.driver.AppleUSBEHCI    5.0.7
    com.apple.driver.AppleUSBXHCI    1.0.7
    com.apple.driver.AppleACPIButtons    1.5
    com.apple.driver.AppleRTC    1.5
    com.apple.driver.AppleHPET    1.7
    com.apple.driver.AppleSMBIOS    1.9
    com.apple.driver.AppleACPIEC    1.5
    com.apple.driver.AppleAPIC    1.6
    com.apple.driver.AppleIntelCPUPowerManagementClient    195.0.0
    com.apple.nke.applicationfirewall    3.2.30
    com.apple.security.quarantine    1.3
    com.apple.security.TMSafetyNet    8
    com.apple.driver.AppleIntelCPUPowerManagement    195.0.0
    com.apple.driver.AppleUSBBluetoothHCIController    4.0.7f2
    com.apple.iokit.IOBluetoothFamily    4.0.7f2
    com.apple.driver.AppleFileSystemDriver    13
    com.apple.driver.AppleUSBMultitouch    230.5
    com.apple.driver.AppleThunderboltDPInAdapter    1.8.4
    com.apple.driver.AppleThunderboltDPAdapterFamily    1.8.4
    com.apple.driver.AppleThunderboltPCIDownAdapter    1.2.5
    com.apple.iokit.IOUSBHIDDriver    5.0.0
    com.apple.driver.AppleUSBMergeNub    5.0.7
    com.apple.driver.AppleUSBComposite    5.0.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice    3.2.1
    com.apple.iokit.IOBDStorageFamily    1.7
    com.apple.iokit.IODVDStorageFamily    1.7.1
    com.apple.iokit.IOCDStorageFamily    1.7.1
    com.apple.driver.AppleThunderboltNHI    1.6.0
    com.apple.iokit.IOThunderboltFamily    2.0.3
    com.apple.iokit.IOSCSIArchitectureModelFamily    3.2.1
    com.apple.iokit.IOFireWireFamily    4.4.5
    com.apple.iokit.IO80211Family    420.3
    com.apple.iokit.IOEthernetAVBController    1.0.1b1
    com.apple.iokit.IONetworkingFamily    2.1
    com.apple.iokit.IOUSBUserClient    5.0.0
    com.apple.iokit.IOAHCIFamily    2.0.8
    com.apple.iokit.IOUSBFamily    5.0.8
    com.apple.driver.AppleEFIRuntime    1.6.1
    com.apple.iokit.IOHIDFamily    1.7.1
    com.apple.iokit.IOSMBusFamily    1.1
    com.apple.security.sandbox    177.5
    com.apple.kext.AppleMatch    1.0.0d1
    com.apple.driver.DiskImages    331.7
    com.apple.iokit.IOStorageFamily    1.7.2
    com.apple.driver.AppleKeyStore    28.18
    com.apple.driver.AppleACPIPlatform    1.5
    com.apple.iokit.IOPCIFamily    2.7
    com.apple.iokit.IOACPIFamily    1.4

  • Better solution for scaling of value

    Hi,
    We have a requirement of scaling the values retrieved in reports, We had two solutions,
    1) Use EvGTS function to scale vale
    2) Use Excel functionality to scale the value
    Please let us know which is a better solution.
    Thanks & Regards,
    Ramanathan

    Hi Ramanathan,
    You can use EvGTS function, because it retrieves the data and also scales the values.
    Regards,
    Raghu

  • Oracle date string parser

    I really want that oracle can change their command parser engine to be smart enough especially for date string parsing.
    currently the engine will throw error when we type a date string as (for example) '10/10/10', while this command can be accepted in MS-SQLServer.

    AMaster wrote:
    i have stored three numbers in three different variables and want to join all of them to concatanate:
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/operators003.htm
    make a date string , kindly help me with this.
    Edited by: AMaster on Sep 6, 2012 4:12 AMto_date:
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions183.htm
    How to ask a question:
    SQL and PL/SQL FAQ

  • Solution needed for Blocked material problem

    Hi Guys,
    Scenario  :   There are two plants in a Location(Plant A & B) and a Customer.Now the Material is blocked  so that after the sales order the material will not be allowed to move from Plant A to B as well as the
    material will not be moved to the customer end.
    Solution needed :  I need to move the blocked material from Plant A to Plant B,But the material shouldn't be transferred  to  the customer end.
    How should I proceed for this problem?
    Regards
    Jino.

    hi,
    Theres a functionality in the material master...MRP view were u cld deifne theplant spcfc material status were u cld define the status and even u cld fnd it in Sales organisation data were u cld block for the particular functionality...
    PLS check that and define as per u r reqmnt.. and try
    Hope this helps u out
    Regards,
    sravanthi
    Edited by: Sravanthi683 on Jun 22, 2009 1:45 PM

  • Oracle UCM/IPM Issue - Urgent Solution needed

    Hi folks,
    Solution needed for the below problem in oracle IPM/UCM cluster .
    General Scenario :
    The document checked in Oracle UCM can be viewed through IPM Viewer only if the security group of the document is set to a IPM Profile .
    The IPM Profile is created in Oracle UCM Configuration Manager Component whenever a application is created in IPMServer .
    Issue in Clustering :
    IPMApplication created in host 1 is creating profile in UCM Component Manager of host 1 but not in UCM Host2 component manager (Vice Versa).
    This affects url generations of checked in documents through proxy since the IPM profile is not available in cluster.
    Scenario :
    IPM MetaData UCM Component Manager(Profile)
    Host1 Host2 Host1 Host2 Host1 Host2
    IPM_APP_1 Visible Visible Visible Visible Not Visible
    Visible IPM_APP_2 Visible Visible NotVisibe Visible

    hi
    Error Message is- "Invoiced quantity is greater than mother invoice quantity".
    this error means your Depot invoice quantity is high, please check your mother invoice quantity, its means branch invoice quantity , and depot invoice quantity , is deferent so , please check both invoice quantity ,
    and also check you migo,
    ME21N-VL10B-VL02N-VF01-J1IIN-MIGO-VA01-VL01N-J1IJ-VF01, in this process you can do J1IG , Its process
    me21n-vl10b-vl02n-vf01-j1iin-migo-j1ig-va01-vl01n-j1ij-vf01, this is process of depot sales, so please check this process

  • Can't load up dates to iPhoto when I try it says 10.8.2 or better is needed I have that on my MAC what to do

    Can't load updates to iPhoto when I try it says 10.8.2 or better is needed. I have that, it was loaded by a tech at the genius bar in August.  How can i correct this?  Fried

    What version of iPhoto are you currenty running and what version do you want to update it to? Where are you trying to get the update from?
    OT

  • Old table style that i'm surprised Indesign doesnt have a better solution for

    Hey guys, I had a question about indesign tables. In one publication I am working in, the client has expressed a desire for table to be done the way they always did them which is the following.
    When the table is first being introduced to the reader (that is when it starts) it has a .75 stroke above. however if the header row occurs on any succeding pages, then that stroke should be .25 like any other strokes that may occur on the table (like at the bottom, or the line under the headers.
    This is so simple but right now it has me stumped. Is there any way to do this in an easier fashion than having to convert the header to a body row recreate or fake the header row by putting it into the regular flow of rows? Thanks all!

    Yeah, that's what I'm saying: you can't just apply a stroke to the top of a frame, and if your objects aren't anchored then you risk the possibility of a number of lines randomly floating around. The whole point of anchored objects is to anchor them to a particular point in the text, so when they text reflows they follow along. So: use the pen tool to draw your line, copy it to your clipboard, create an anchored object, manipulate it until it's sitting exactly where you want it, and paste your new rule in.
    Positioning anchored objects precisely works well once you understand the interface, but the first time out I found it really confusing, hence my link to the help file entry on anchored objects.
    There may well be a better solution for your issue, but this duct tape is what came immediately to mind.

Maybe you are looking for

  • Won't show when uploaded from CD

    Someone please help me! I recently got a new Macbook (yay! I love it!) and i burned my pictures onto a disc from my PC and uploaded them onto my macbook fine, but when I want to view those pictures, it says it needs to find the file and it won't open

  • Contact Item created in Office 365 website opened in Outlook 2013

    Hello, Is it possible to open a "Contact Card" created via web in Office 365 OWA, on your locally installed Outlook 2013 using its unique "Contact.EntryId"? I have Delphi application which connects to outlook via COM/OLE. My goal is to retreive the C

  • Pages 5: Insert File Name

    How do I insert the File Name? How do I update an old File Name that was previously inserted? It's common practice to insert the document name in the footer of document, so people reading the document know what version the file was printed from. This

  • Ps Elements 6 - Editor not working

    Greetings. First, I want to describe my frustration. I've been surfing Abode's site for more than 60 minutes trying to figure out how to access the contact support, by email rather than phone. It's very  common for any manufacturer to have an email c

  • Function or bapi returning customers or vendors with open items

    Dear experts. may you please tell me which function or bapi can i use that will return all customers or vendors with open items per given plant. i have tried to use BAPI_AR_ACC_GETOPENITEMS and BAPI_AP_ACC_GETOPENITEMS but they return open items for