Regular expression: remove quotes except where there is a pipe in the middle

input file:
Column1|"Column | 2"|Column 3|Column 4
Column 1|"Column" 2|Column 3|Column 4
require a sed/awk command to end up with
Column1|"Column | 2"|Column 3|Column 4
Column 1|Column 2|Column 3|Column 4
i.e. remove double quotes but only when there's no pipe contained within the quotes.
Any ideas? I need it to be a one liner preferably, as this will go into an 11g external load pre-parser.

Hi - That's right technically, but I guess this is what the OP needs: "remove double quotes but only when there's no pipe contained within the quotes." As per my understanding, it also implies that there could be a double-quote between the pipe symbol. If you see both the sample files of the OP's and yours - marked 1 and 2 there is a double quote that does not need to be removed.
input file:
Column1|"Column | 2"|Column 3|Column 4 -->1
Column 1|"Column" 2|Column 3|Column 4
testfile:
Column1|"Column | 2"|Column 3|Column 4
Column 1|2 "Column 2|Column 3|Column 4 -->2

Similar Messages

  • Can you use home share where there are 2 itunes on the same computer but under different user profiles?

    Can you use 'Home Share' where there are 2 itunes on the same computer, but under different user profiles?

    check out method one from this support article -> How to use multiple iPods, iPads, or iPhones with one computer

  • Get only the rows where there are no matches in the tables

    To include in the results of a join with no matching rows, you can use a full outer join. In MS SQL Server provides the FULL OUTER JOIN operator, which allows you to include all rows from both tables, regardless of the presence or absence of values.
    You can add a WHERE clause in a FULL OUTER JOIN to get only the rows where there are no matches in the tables. The following query returns only those products for which there are no matches in the sales order.
    SELECT p1.Name, p2.SalesOrderID
    FROM  TAB1 p1
    FULL OUTER JOIN TAB2 p2
    ON p1.ProductID = p2.ProductID
    WHERE p1.ProductID IS NULL
    ORDER BY p.Name ;
    FULL OUTER JOIN is not supported in ABAP.  How can you solve this?
    Thanks in advance,
    Serena

    Similar problems can often be solved by using subqueries, please have a look here and try applying it.
    http://help.sap.com/abapdocu_702/en/abenwhere_logexp_subquery.htm
    Thomas

  • There is black bar in the middle of my screen.

    There is black bar in the middle of my screen. I have a Macbookair, 2011. I was writing in word when it happend.
    I have restarted the machine, its still there, done a hardware test, nothing is wrong. What should I do

    If the black bar appears immediately upon booting (at the grey screen) then I'd suspect you have a hardware failure of part of the screen. 
    An external monitor could help confirm that it's not a software issue where OSX *thinks* there should be a black bar there :-) .  If you hook up an external monitor and have OSX set to mirror the displays (which I believe is the default setting for a new monitor) see if the black bar is also on the external monitor.  If it's not, I think you need a new screen for the Air.

  • The computer recently ask me for an update for mavericks and after i did the update there a white smug in the middle of the screen. how can i fix this?

    the computer recently ask me for an update for mavericks and after i did the update there a white smug in the middle of the screen. how can i fix this?

    smug?

  • Regular Expressions - Removing a Timestamp?

    I have hundreds of plain HTML pages. I'd like to remove the
    timestamp from them, which looks like this:
    [19:45]
    I've tried using the wildcard feature, but the problem is is
    that I want the BRACKETS gone, as well. Unfortunately, I've only
    succeeded in removing either the last bracket (with the open
    bracket and time still intact) or all of my data completely. How
    can I successfully delete the varying times and their brackets
    without touching the rest of my data?

    In Find/Replace, with Use Regular Expression turned on:
    Find:
    \[\d\d?:\d\d?\]
    Replace:
    (leave it blank)
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • Regular expression - removing emails

    Hi,
    How to use regular expressions to remove email addresses from
    html files ?
    Thanks in advance.
    Maxcx

    maxcx wrote:
    > Hi,
    > How to use regular expressions to remove email addresses
    from html files ?
    > Thanks in advance.
    > Maxcx
    Do you want to remove the email address, or to remove the
    whole <a>
    tag containing same?
    Mick

  • Hi, when I open firefox, there's a box in the middle the screen that says:"Thanks for choosing Firefox! To get the most out....".

    Is there any way to remove that annoying box ? thanks Sonny

    You can hide the box that shows the snippets with code in userChrome.css
    Add code to [http://kb.mozillazine.org/UserChrome.css userChrome.css] below the @namespace line.
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #snippetContainer {display: none !important; }</nowiki></pre>
    * http://kb.mozillazine.org/Editing_configuration
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html

  • When I open Google there is a space in the middle of the screen to type in what I need to search but I cannot find anything similar to that in Firefox.

    When I open firefox where do I type what I am looking for; similar to how Google has it in the middle of the screen. Where do I type in the words. So frustrating that something so simple is not easily found and your 'tour" did not show this. At this point, I do not like firefox.

    What is the home page and have you set to show the home page on startup?
    *https://support.mozilla.org/kb/How+to+set+the+home+page
    You can set the homepage to the build-in about:home page if you want a page with a search bar.

  • Why is there a microphone icon in the middle of my screen?

    Just recently, a large microphone image has appeared in the middle of my Mac mini screen (see partial screen shot). It stays in front of all open windows, and while transparent, is very disruptive. What is this and how do I remove it?

    Well.... F11 removes it!! But, it unfortunately also makes all open windows slide off the screen, clearing my desktop. If I click on any icon in the dock to bring it back, so returns the microphone. (sigh) Also, when I open sys pref / sound - I don't see any option to remove that icon. Nor does anything I try work. 
    ps - Thanks for your reply BDAqua!

  • Where'd that black line down the middle come from?

    I have a black line down the middle of each page of a template that is visible in the PDF Export. Since this is a magazine template, is it supposed to be there?
    Thx.
    Paul

    Okay, as long as it's okay that it shows up in the PDF export.
    Thx.

  • Thumbnail of the pdf contains blank section where there were images. However, the text is displayed.

    Hi there,
    I was trying to get thumbnail images of the pdf pages using coldfusion 10 cfpdf. Thumbnails have been generated for most of the pdf files. However, for one particular pdf file, the text in the pdf file were displayed properly but the image section was blank for the generated thumbnail image. I have tried genearting a normal image (tiff format) of the pdf page but the tiff file also has blank section in the place of images. I came across the below page and found that the image in the pdf might be of jpg 2000 format.
    http://stackoverflow.com/questions/1033503/cfpdf-thumbnail-problem-not-showing-background- images
    This has been a know issue in the Coldfusion 8. But I am unable to get the information about this issue in the Coldfusion 10 version. Could anyone please help me to resolve this problem?

    There are a few options for you here. In the Inspector>Metrics Tab, when you click on the picture, it will display the name. Then you can use the find feature of the Finder to locate the picture. If you have Keynote set to save files as Packages, you can right click the file in the Finder (or control click) and then select Show Package Content. This will show you all the files that make up your Keynote and you can copy the pictures out of there into a new folder. Finally, if you can't find them any other way, you can select and copy the picture in Keynote, then open Preview and command-n (or File Menu>New from Clipboard) and then save the file to where ever you want so you can find it.

  • Deleting data from a table where there are no indexes on the table

    Hi
    We have one interface program for one time process.When I was testing the process it was taking too much time to load the data around 1000 records.
    it happens in 2 steps
    1 puts into stage table
    2 puts into base table
    in the process/package I have delete statement that deletes data from stage table before each process.
    Stage table did not have any indexes but the base table has(obvisiosly)
    any idea?
    please help me on this.
    Thanks,
    Y

    Hi,
    Please post the application/database details along with the OS.
    Is this interface program a seeded or custom one?
    Please enable trace on this concurrent program as per (Note: 296559.1 - FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12) and generate the TKPROF to find out why it takes that long to load/delete the data.
    Thanks,
    Hussein

  • ClickOnce Programmatic deployment checks for updates if there is a failure in the middle of an update

    Hi,
    I am using ClickOnce deployment APIs in C#.
    The application is checked not to "Check for updates". Unfortunately, due to some slow internet connectivity issues the deployments sometimes fail.
    When such a scenarios happens, the next time the application is restarted it will prompt the "There was an update" dialog even though the Project ClickOnce settings are set not to check for updates.
    I couldn't find any solutions or documentation. Any help would be appreciated!
    This is my code:
    if (IsUpdated())
    nextProgress = 0;
    logger.Info("Found new version! UPDATING...");
    applicationDeployment.UpdateAsync();
    // We use this instead of applicationDeployment.CheckForUpdate(false) because applicationDeployment.CheckForUpdate(false)
    // Is limited to a few hundred calls only (Microsoft BUG: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/d9183f7e-f5c7-46d0-8bb4-411ad923976c)
    int checkUpdateError = 0;
    private DateTime _lastCheck = DateTime.MinValue;
    public bool IsUpdated()
    try
    var customVersionUrl = System.Configuration.ConfigurationManager.AppSettings["CustomVersionUrl"];
    var manifestFile = GetIfModifiedtSince(customVersionUrl != null ? customVersionUrl : TBXConfigurationManager.Settings["VersionURL"], _lastCheck);
    if (manifestFile != string.Empty)
    var xdoc = XDocument.Parse(manifestFile);
    XNamespace nsSys = "urn:schemas-microsoft-com:asm.v1";
    var version = new Version(xdoc.Descendants(nsSys + "assemblyIdentity").First().Attribute("version").Value);
    _lastCheck = DateTime.Now.AddMinutes(-10);
    if (version != ApplicationDeployment.CurrentDeployment.CurrentVersion)
    // update application
    return true;
    checkUpdateError = 0;

    Hi uriab,
    As you said that, you have something wrong when you update the Version of application. Due to the network, I'm afraid you have missing something important for the updation version.
    I suggest you uninstall the older version, then reinstall the lastest version from the server.
    And also here is a MSDN article about How to Check for Application Updates Programmatically Using the ClickOnce Deployment API.
    #How to: Check for Application Updates Programmatically Using the ClickOnce Deployment API
    https://msdn.microsoft.com/en-us/library/ms404263.aspx
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Regular Expression and PL/SQL help

    I am using Oracle 9i, does 9i support regular expression? What functions are there?
    My problem is the birth_date column in my database comes from teleform ( a scan program that reads what people wrote on paper), so the format is all jacked up.... 50% of them are 01/01/1981, 10% are 5/14/1995, 10% are 12/5/1993, 10% are 1/1/1983, 10% are 24-JUL-98. I have never really used regular expression and pl/sql, can anybody help me convert all of them to 01/01/1998?
    Does Oralce 9i support regular expression? What can I do if oralce 9i does not support regular expression? Thank you very much in advance.

    9i doesn't support regular expressions (at least not in the 10g regular expressions sense. There is an OWA_PATTERN_MATCH package that has some facilities for regular expressions). But it doesn't look like this is a regular expressions problem.
    Instead, this is probably a case where you need to
    - enumerate the format masks you want to try
    - determine the order you want to try them
    - write a small function that tries each format mask in succession until one matches.
    Of course, there is no guarantee that you'll ever be able to convert the data to the date that the user intended because some values will be ambiguous. For example, 01/02/03 could mean Feb 1, 2003 or Jan 2, 2003 or Feb 3, 2001 depending on the person who entered the data.
    Assuming you can define the order, your function would just try each format mask in turn until one generated a valid date, i.e.
    BEGIN
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_1 );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_2 );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_3 );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_N );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      RETURN NULL;
    END;Justin

Maybe you are looking for