REG EXP to clean unwanted data

Hi
I seen some solutions and explanations to the above problem, My problem is getting feed from cobol and getting lot of unwanted characters. I want to delete all new line/carriage feed and any other to be trimmed but to leave reguilar a to z characters intact. I want a function that I can cal;l from sql *loader.
I appreciate your response.
thanks
Gopala

Hi..
  First of all read the excel data into an internal table using a function module GUI_UPLOAD or use the method GUI_UPLOAD of the class CL_GUI_FRONTEND_SERVICES.
Loop at the internal and process each record and either transfer the required data into another internal table or delete the unwanted from the same table.
Use the function module GUI_DOWNLOAD or the method GUI_DOWNLOAD of the class CL_GUI_FRONTEND_SERVICES to download data into a text file.
The program should contain Input and Output file paths as Selection Screen parameters.
Regards,
Vara

Similar Messages

  • REG EXP pattern ?

    Hi Folks;
    I need to create a reg exp pattern with these rules :
    mpexprfinal      : mpexprUnit(\ OROP\ mpexprUnit)*
    mpexprUnit      : mp(\ AND\ mp)*minusplusexpr
    minusplusexpr :     "\ \(+\)\ " or "\ \(-\)\ "
    mp : "[A-Z]{1}[0-9]{6}" (ex: I123456)
    OROP : ","
    Help me please!
    Edited by: Moostiq on 2 mai 2011 16:52
    Edited by: Moostiq on 2 mai 2011 16:52

    Hi,
    I don't know of any really good way to assign names to sub-patterns in a regular expression, and then use those names in bigger expressions.
    You can (sort of) do the same thing in SQL, by assigning column aliases to string literals (as in def_1, below), or concatentions of literals and previouslly defined aliases (as in def_2):
    WITH     def_1         AS
         SELECT     '\(\+|-\)'          AS minusplusexpr
         ,     '[A-Z]{1}[0-9]{6}'     AS mp
         ,     ';'               AS orop
         FROM     dual
    ,     def_2        AS
         SELECT  def_1.*
         ,     mp || '( AND '
                 || mp
                 || ')*'          AS mpexprunit
         FROM    def_1
    SELECT     x.*
    FROM          table_x     x
    CROSS JOIN     def_2     d
    WHERE     REGEXP_LIKE ( x.txt
                  , d.mpexprunit || '('
                                 || d.orop
                           || '|'
                           || d.mpexprunit
                           || ')*'
    ;Take this as pseudo-code. I'm not sure it will do anything. (I can't test it until you post some sample data).
    If it does run, I'm not sure it will do what you want (since you haven't explained what you want).
    You may find it easier just to repeat the expressions in your code. An approach like the one above is most useful when the definitions (mp, mpexprunit, and so on) change frequently.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using. I'm not sure you'll need any features that were added after Oracle 10.1, but why take a chance?

  • How can I clean all data in a database but keep all datafile still same nam

    hi,
    How can I get a easy way to clean all data in a database but keep all datafiles still same name and location just like a new created database?
    dbca has two choice: create templet without datafile or with all datafiles but not empty datafiles.
    thanks

    What version is your database? DBCA in 10gR2 allows you to create a template from an existing database using only the structure. From DBCA
    From an existing database (structure only)
    The template will contain structural information about the source database including database options, tablespaces, datafiles, and initialization parameters specified in the source database. User defined schemas and thier data will not be part of the created template.

  • Is there a way to clean up data without restore and backup?

    I noticed recently that too much data is being silently stored on my iPad possibly be apps and caches.
    Isn't iOS supposed to clean up data as it needs free storage?
    most recently, according to usage in settings > general, I had 1.8 GB of free space. I wanted to install an app that is 2GB in size. iOS told me there was not enough free space. I could not find what used so much data, and frankly this time the list of apps in settings > general > usage proved to be pointless. Adding the numbers together of how much space the apps were using up was nowhere near enough to leave me with only 1.8 GB of free space.
    I did a backup, then restored my iPad. After that, I restored the backup with all apps and data I had before. Now I have 7.2 GB free space. 5.4 GB of temporary and junk files, with no way of erasing them, is quite frustrating.
    Anyone knows a solution or shall I just restore my iPad pretty much every 2-3 weeks? (Yes, the last 5 or 6 restores I have performed were solely for freeing up storage space that mysteriously keep being filled up.)
    Additionally, how do I find out which apps use up so much space when settings > general > usage doesn't tell me anything? Only how much space the app itself needs and how much permanent (user generated) data is being stored. Such as pictures, save game files, and so on, but nothing about cache sizes temporary data.
    PS: if the above was asked and answered before, please accept my apologies and could you link me the topic it has been resolved in?

    Hi! And thanks for your reply!
    It sounds sensible. Since the last restore which was just over a day at the time of me writing this reply, there is over 1GB of data unaccounted for. Note that I have not installed new apps, nor DLCs within games. The two I have been using heavily are Netflix and Youtube, both of which should automatically erase temporary data. Or so they claim.
    However, there was a period when I had my iPad on charger overnight. When I woke up, just out of curiosity I checked the usage statistics and I found my free space was about 200 MB less than when I checked immediately before goong to bed. So the iPad was not used at all and somehow I lost 200MB.
    I did try a software for Windows called Phone Clean, but that didn't help. Before the restore, I ran a deep scan, and it only cleaned up about 500MB of data even though there was nearly 5GB unaccounted for. I performed the restore, and that was when I thought this is beyond me, and posted this topic.
    I have also noticed that when I watch a movie with the Videos app by streaming from iTunes instead of downloading, after watching it, the storage will not get freed up. The movie is still there (as confirmed by trying to actually download another that was larger than the current free space, then the previous movie file was indeed deleted by iOS automatically) but it does not show up in usage > videos. According to iOS the Videos.app has no data within.
    I'll try a full reset soon and see how it goes. Obviously it will take some time to test it, but I'll let you know of any results. Luckily, I don't have many apps that don't use iCloud storage so their data should be there despite dropping the backup, and installing them clean should be easy using iTunes on a PC.
    If that doesn't help, I go one step further and download the apps one by one.
    Well, there is plan.
    To be honest, it would really be helpful if we could see individual app containers as that way we can easily find out which app is being naughty.
    Any way, thanks for the tip! Give me a couple of days and I'll let you know how it went.

  • Using HS.Exp function to write data to a Consolidated Account

    Hi,
    Just wanted to know whether i can use the HS.Exp function to write data to a consolidated account?
    Thanks

    Hi Mau,
    In order to write data to a consolidated account, you can use HS.Exp function in rules which puts data into a combination of Account, ICP, and Custom1...4 members. The syntax is: HS.Exp "DestPOV = Expression"
    You might find useful the HS.Con function which puts data into the [Proportion] and [Elimination] Value dimension members and can also be used in Consolidation rules. The syntax is: Call HS.Con ("V#[Elimination]",-1*dPCon,"")
    Regards,
    Thanasis

  • DPM 2012 R2 - Failed to clean up data

    Hi,
    I'm hoping someone might be able to help me.
    I've recently been getting an error on one of our backup jobs, I've tried searching around for solutions but no-one seems to have had the exact same issue that I'm experiencing.
    The backup job is a shadow copy file backup of a complete volume.
    It's been working for the past few weeks but I'm now getting the error below when I try to run a consistency check. 
    People have reported issues similar which suggest executing the pruneshadowcopiesdpm2010.ps1 which I've tried but this seems to make no difference.
    The protection group is short term disk protection with a retention period of 14 days with file recovery points created at 11am, 1.30pm, 3.30pm and 8pm.  The job is currently reporting 32 recovery points which leads me to believe it shouldn't need to
    clean up any yet anyway.
    Any suggestions would be very much appreciated.
    Type: Consistency check
    Status: Failed
    Description: DPM failed to clean up data of old incremental backups on the replica for Volume D:\ on nas01.nwhs.local. Synchronization will fail until the replica cleanup succeeds. (ID 30134 Details: Cannot create a file when that file already exists (0x800700B7))
     More information
    End time: 29/04/2014 18:48:03
    Start time: 29/04/2014 18:48:02
    Time elapsed: 00:00:01
    Data transferred: 0 MB
    Cluster node -
    Source details: D:\
    Protection group: User Data
    Items scanned: 0
    Items fixed: 0

    RIS,
    The access denied can come if there is already a lock on the file( like Antivirus). 
    Can you let me know what version of DPM2012R2?   if you goto about DPM you it will give you exact version 4.x.xxxx.x.  You stated you had AV exclusions set
    "We do run Sophos Antivirus but it does have exceptions set and the volumes that are being protected do not store any Sophos related data."
    I want to ensure all are set from -
    http://technet.microsoft.com/en-us/library/hh757911.aspx - if you can test disabling AV that may help.
    Can you check the event logs on DPM server and PS during the failure to see if there is anything else running that may lock the files?
    There may also be a "failedfiles.dat" that may due to unsupported files see link below for assistance troubleshooting that -
    http://social.technet.microsoft.com/Forums/en-US/f7de60cd-841f-4d22-862e-aaf3723717c7/dpm-could-not-log-files-that-were-skipped-during-backup-to-volumexxxxxfailedfilesdat-id?forum=dataprotectionmanager
    How to read failedfiles.dat if there is one -
    http://social.technet.microsoft.com/Forums/en-US/dataprotectionmanager/thread/27c48816-dabb-41a0-b800-6e1ac2fc1ed5
    Also what is the OS version of the DPM server?  Are you doing any dedupe\ODX\Thin provisioning on the protected server? 
    Ultimately we may need a ticket to determine what is locking out the file during the failure but please let me know the answers to the above and I will see if that helps.  Thanks
    Regards, A.Nadar, This posting is provided "AS IS" with no warranties, and confers no rights.

  • Sm36 job with unwanted data

    hi experts,
    i am using the following functions in my ALV.
    1.REUSE_ALV_FIELDCATALOG_MERGE
    2.REUSE_ALV_BLOCK_LIST_INIT
    3.REUSE_ALV_BLOCK_LIST_APPEND
    4.REUSE_ALV_BLOCK_LIST_APPEND
    while running alv thru se38 there is no unwanted data. while running the same prg thru sm36 and seeing in a mail (HTML Format)  i am getting the following message.
    Sort criteria Ascdg Descnd Subtotal
    Inv Date X X
    Data statistics Number of
    Records passed 9
    Calculated total records 6
    How to remove this unwanted data. Kindly help me.
    Thanks  & Regards
    R.vijai

    I think u r using the FM REUSE_ALV_BLOCK_LIST_DISPLAY to display the report. In this Fm we have one parameter called
    IS_PRINT. Check these fields : PRNT_INFO,no_print_selinfos,no_coverpage,no_print_listinfos for this parameter. Any one of the field is responsible for displaying this unwanted data.

  • Need to remove unwanted data in log file

    hai experts,
                    how to identify and remove the unwanted data from log file.plz help me.
    regards,
    pugazh.

    brarchive takes a backup of all offline redologs, then deleted them. this is done at OS level.
    if you do not need them and you do not need archiving, a permanent solution is to disable archiving:
    stop SAP first, then:
    sqlplus / as sysdba
    shutdown immediate;
    startup mount
    alter database noarchivelog;
    alter database open;
    exit
    after this, you will never be able to do a recovery point-in-time, and won't be able to start online backups.

  • How to clean session data

    how do you clean session data after access 2-3 webapps in 3 diff JVMs aftre logout?

    how do you clean session data after access 2-3 webapps in 3 diff JVMs aftre logout?

  • A doubt on REG EXP

    Hi friends,
    Please clarify the following doubt in Reg Exp.
    Table EMP has following EMP_NAMEs:
    ============
    Anand
    Bala_G
    Chitra
    David_C
    Elango
    Fathima
    ============
    We have a set of characters as "abcdefghijklmnopqrstuvwxyz0123456789".
    Now we need to find the count of EMP_NAMES whose characters (any) are not in the list of characters in the above list. In this example, the result should be 2. i.e., 'Bala_D' and 'David_C'. The query should be like:
    Declare
    v_string varchar2(50) := 'abcdefghijklmnopqrstuvwxyz0123456789';
    v_count number(6);
    Begin
    select count(*)
    into v_count
    from emp
    where regexp_like(emp_name, v_string);
    dbms_output.put_line(v_count);
    end;
    ========================
    Thanks in advance!

    Hi,
    Welcome to the forum!
    To use REGEXP_LIKE, you could say:
    WHERE     REGEXP_LIKE ( emp_name
                  , '[^abcdefghijklmnopqrstuvwxyz0123456789]'
                  )However, it will be faster not to use regular expressions:
    WHERE   LTRIM ( emp_name
               , 'abcdefghijklmnopqrstuvwxyz0123456789'
               )          IS NOT NULLEdited by: Frank Kulash on Oct 10, 2012 4:18 PM
    Removed extra single-quote, after DAMorgan, below.

  • How to make Matcher stop once a reg exp match is found

    Is there a way to make the regular expression Matcher stop reading from the underlying CharSequence once it finds a match? For example, if I have a very long String and a match for some regular expression is at the beginning of the String, can I make the Matcher object stop examining the String once it finds the match? The Matcher object seems to always examine the entire CharSequence, even if a match is very near the beginning.
    Thanks,
    Zach Cox
    [email protected]

    Nope, {1}+ doesn't work either. I know it's
    continuing because I created my own CharSequence
    implementation that just wraps a String orwhatever,
    and I print to System.out whenever Matcher callsthe
    charAt method.What about the lookingAt() method?I think lookingAt is like matches, except just the beginning of the CharSequence has to match (i.e. starting at index 0), not the entire thing. I tried it and it doesn't even find the reg exp. The find method at least finds the reg exp, it just reads too far.

  • Reg Exp - not as expected

    Not often I ask questions myself, and perhaps my mind's just gone fuzzy this morning, but I'm having trouble doing a simple replace with regular expressions...
    In the below example I just want to replace all occurences of "fred" with "freddies"...
    SQL> ed
    Wrote file afiedt.buf
      1* select regexp_replace('this freddies is fred fred record', 'fred', 'freddies') from dual
    SQL> /
    REGEXP_REPLACE('THISFREDDIESISFREDFREDRECORD'
    this freddiesdies is freddies freddies recordbut, obviously, I don't want the existing "freddies" to become "freddiesdies", it should stay as it is. So if I check for spaces either side of the search string (and take account of it maybe being at the start/end of the string...
    SQL> ed
    Wrote file afiedt.buf
      1* select regexp_replace('this freddies is fred fred record', '(^| )fred( |$)', '\1freddies\2') from dual
    SQL> /
    REGEXP_REPLACE('THISFREDDIESISFREDFRE
    this freddies is freddies fred record
    SQL>It no longer replaces the "freddies" incorrectly, BUT it only replaces the first occurence of "fred" with "freddies" and not the latter one. ?!?!?!
    If I put an extra space inbetween the two "fred"s then it works:
    SQL> ed
    Wrote file afiedt.buf
      1* select regexp_replace('this freddies is fred  fred record', '(^| )fred( |$)', '\1freddies\2',2) from dual
    SQL> /
    REGEXP_REPLACE('THISFREDDIESISFREDFREDRECO
    this freddies is freddies  freddies record
    SQL>But I'm not going to have double spaces between the words and I can't determine where to insert them to make it work like this so it's not a feasible solution, although it does seem to highlight that the regular expression parser is not taking the space after the first match in the context of being the space before the second match.
    Is that a bug in the regular expression parser, a feature of the way regular expressions work (i.e. expected) or am I doing something wrong with my search and replace reg.exp. strings?
    Cheers

    I think this will explain ..
    SQL> select regexp_replace
      2         ('this freddies is fred fred  fred record',
      3          '(^| )(fred)($| )','\1freddies\3') str
      4  from dual
      5  /
    STR
    this freddies is freddies fred  freddies record
    1 row selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reg Exp always returning false value

    Hi,
    Below is my code. I want to restrict the values to only alphabets and numbers and not special char.
    But the below condition fails on a positive value also. Ex: ABCD, abcd, 1234. These should be acceptable.
    Is the reg exp wrong?
    private var special_char:RegExp = /^[A-Za-z0-9]*$/;
                                  private function validateSpecialChar(inputValue:String):Boolean {
                                            if (special_char.test(inputValue))
                                                      valid = true;
                                            else
                                                      valid = false;
                                            return valid;
    Thanks,
    Imran

    Try: http://stackoverflow.com/questions/9012387/regex-expression-only-numbers-and-characters

  • Reg Exp won't make a match with metacharacters?

    Hi All,
    I'm trying to implement a filefilter using regular expressions to allow wildcard searches. Here is the code I have so far. Works fine for a literal match, but if i enter a wildcard search (eg. abc123) it will not list any files, even though if I enter the full name for a file, it matches just fine. Anyone got any ideas because I'm just comming up blank?
    thanks!
    package dbmanager2;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.regex.*;
    * @author nkelleh
    public class LotDialog
        // Declare variables
        private String[] dirFiles;
        // Class constructor
        public LotDialog(String path, String name)
            // Create new file object based on path name given
            File dir = new File(path);
            // Assign file names to string array
            dirFiles = dir.list(new stdfFilter(name));
        public void printFiles()
            for (String files : dirFiles)
                System.out.println("File is " + files );
        class stdfFilter implements FilenameFilter {
            Pattern pattern;
            public stdfFilter(String search)
                // Replace wildcard, '*', with reg exp, '.*'
                search = search.replaceAll("\\*", ".*");
                search = search.replaceAll("\\?", ".");
                pattern = Pattern.compile(search);
                System.out.println(pattern.pattern());
            public boolean accept(File dir, String name)
                if (new File(dir,name).isDirectory())
                    return false;
                else
                    // Return true if a match is found
                    Matcher matcher = pattern.matcher(dir.getName());
                    return matcher.matches();               
    }

    LeWalrus wrote:
    Hi All,
    I'm trying to implement a filefilter using regular expressions to allow wildcard searches. Here is the code I have so far. Works fine for a literal match, but if i enter a wildcard search (eg. abc123) it will not list any files, even though if I enter the full name for a file, it matches just fine. Anyone got any ideas because I'm just comming up blank?
    ...Try debugging your code. A good place to start is to print the following to see where things go wrong:
    public boolean accept(File dir, String name)
      if (new File(dir,name).isDirectory())
        System.out.println("Ignoring: "+new File(dir,name));
        return false;
      else
        Matcher matcher = pattern.matcher(dir.getName()); // shouldnt that be 'name' instead of 'dir'?
        System.out.println("Accept: "+dir.getName()+"? "+matcher.matches());
        return matcher.matches();               
    }

  • Reg Exp confusion when searching for a '(' char

    Hello,
    I am trying to extract the name from the following HTML.
    onclick="searchCitationAuthor('Inoue, K.', true);">I want to be able to extract 'Inoue, K.'.
    My regular expression is as follows.
    "\\=true\\)\">([^<]+)</a>";I need to extract from the entire line of code. I need to extract from the =true chars as this makes the Reg Exp distinctive.
    I think the ')' char is confusing things.
    Can anyone suggest anything?
    Message was edited by:
    VanJay011379
    Sorry, I realize i was missing a ';' char. I thought the "\\)" was causing problems. Move on, nothing to see here LOL : )

    why not
    String regex = "searchCitatationAuthor\\s*\\(\\s*'([^']*)'"
    where is =true coming in though?

Maybe you are looking for

  • Converting,importing,timeline......

    i recently converted a uncopyrighted dvd using streamclip &mpeg-2 playback for import into fce hd.settings were apple dv dvcpro ntsc..fps 29.97...exported to quicktime..imported into fce..but when taken to timeline..yes..it says..unrendered..its on s

  • Sql developer issue using all_source

    Hello, New policies in my company have revoked access from developers to system tables which has caused a problem using sqldeveloper. Basically when I attempt to open a stored procedure, sqldeveloper uses sys.all_source to put together the code and n

  • Is it possible keep reports independent of schema name using procedures

    Hi everyone, I have created reports using stored procedures.These stored procedures are inside a package in a particular schema. Now if the schema name differs at the client side,it is not possible to view reports. Is there any solution for the same.

  • Why won't quicktimes and mpegs import into iTunes?

    I'm trying to make a playlist of videos in iTunes. Several of my movies won't import when I drag and drop them. Some were created in Final Cut Pro 7 as basic MOV. One is an MPEG I received frome someone. Why won't they import? thanks Scott

  • Don't allow Goods Receipt with quantity zero in EBP

    Hi If  a Goods Receipt is confirmed with the quantity zero and the "Last Delivery" flag is set in EBP, iin the R / 3 there will be also created a Goods Receipt with the quantity zero. Later It is not possible to delete or cancel it in R/3. In order t