Extract from a list



  • Hello, I have come to ask for your help, I have a list of 50,000 lines and I would like to obtain only the following data, for example

    (2X0997,‘navx8n’,‘nap345’,’’,’’,‘Nava’,‘A’,‘firstname@yahoo.com’,‘no 2Z,n street,saras ng,selaiyur’,’’,‘chennai’,'TN ',‘IN’,‘0000X3’,‘0000-00-00’)

    to

    nap345 firstname@yahoo.com

    Of this I only need the third and the mail in all the lines
    It could be on notepad, I thank you very much, thank you very much



  • @Pedro-Contreras ,

    Assuming your post converted ASCII quotes to smartquotes because you didn’t use the </> button in the forum, then an answer that works for the data you presented is to use regular expression mode with FIND = (?-s)^([^,\r\n]*?,){2}'([^,\r\n]*?)',(?1){4}'([^,\r\n]*?)',.*$ and REPLACE = $2 $3

    (2X0997,'navx8n','nap345','','','Nava','A','firstname@yahoo.com','no 2Z,n street,saras ng,selaiyur','','chennai','TN ','IN','0000X3','0000-00-00')
    

    becomes

    nap345 firstname@yahoo.com
    

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as literal text using the </> toolbar button or manual Markdown syntax. To make regex in red (and so they keep their special characters like *), use backticks, like `^.*?blah.*?\z`. Screenshots can be pasted from the clipboard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get. Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.


Log in to reply