Results 1 to 2 of 2

Thread: Keep rows containing specified text strings
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    North Yorkshire, UK
    Posts
    263
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Keep rows containing specified text strings

    Apologies if this is a "newb" question, but Power Query is completely new to me and I've no idea how to go about this...

    I have a text file which is data dump from our email client and contains almost a million rows, most of which I don't actually need for the report I'm creating. The data is a single column for each record and looks something like this (anonymised):
    ACL check OK, connection accepted from peer <123.4.567.89>
    Message from: [abcd.efg@companyone.com]
    Message to: [joe.bloggs@companytwo.com]
    ..Scanning decoded file. HH01_18_08_00_08_27.jpg

    What I need to do is to only pull through rows which contain the text strings "message to" or "message from"

    I'm using Excel as part of the Microsoft Office Professional 2013 Suite and have downloaded and installed the Power Query AddIn from Microsoft.

    I've created the basic query by linking to the text file, but it's bringing through all records rather than just those containing "message to" or "message from"

    Any suggestions as to how to do this would be gratefully appreciated!
    It's curtains for your Dr. Horrible ... lacy, gently wafting curtains.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    North Yorkshire, UK
    Posts
    263
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Keep rows containing specified text strings

    Panic over, I've found how to do it!

    Edit Query, and THEN click the filter box in the top right and apply whatever parameters are required for your filtering. Microsoft could have made that a bit more obvious to find, although having now found it, it seems obvious with hindsight.

    I had been trying to filter the data that had been brought through instead of filtering beforehand. I'd also played around with Parameters, but that wasn't what I needed in this instance.

    I've managed to go from 798,000 records in total to the 168,000 that I actually need. I can then further manipulate those records with VBA merging them with data from other sources to generate my final report. I may ultimately be able to do everythign in Power Query, but this will work for now until I've learned more about the feature.
    It's curtains for your Dr. Horrible ... lacy, gently wafting curtains.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •