+ Reply to Thread
Results 1 to 7 of 7

Power query import based on specific row

Hybrid View

  1. #1
    Registered User
    Join Date
    04-17-2020
    Location
    Newcastle
    MS-Off Ver
    office 365
    Posts
    66

    Power query import based on specific row

    Hi All,

    I need to load log files which have junk in the first 4 lines, when i try and import via power query it doesnt detect all columns because its looking at those top rows. I only see Data Type Detection = 'based on first 200 rows', 'on the entire data set' or 'dont detect datasets'. None of these options work for me. I have to open the log file in a text editor and delete the lines causing the problem.

    is there a way to do this based on a specific row or set of rows, anything after those first 4 lines would help me out i think

    thanks!

  2. #2
    Registered User
    Join Date
    04-17-2020
    Location
    Newcastle
    MS-Off Ver
    office 365
    Posts
    66

    Re: Power query import based on specific row

    Hi Team, any ideas about this one?

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Power query import based on specific row

    Can you post a small sample log file that demonstrates the problem? It might help determine a fix
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Registered User
    Join Date
    04-17-2020
    Location
    Newcastle
    MS-Off Ver
    office 365
    Posts
    66

    Re: Power query import based on specific row

    Hi Rorya,

    See attached. This should have an extension of .log but i couldnt upload that for some reason. If you use the data import from text file wizard i would usually import from row 4, then delete the 'fields' cell and everything would be lined up and looking right.

    I have a bunch of these files with hundreds of thousands of rows, i wanted to be able to load them all as they are (without removing the stuff i dont need at the top (ie. everything below). Ideally i wanted to load it into the data model so I could summarize and pivot the data for some reports. Its not only more work to import the files but due to thier size i will quickly hit the 1 million row limit if i do that it that way so breaking it up into multiple sheets and then aggregating the data is also not a great way of doing it.

    Thanks!


    #Software: Microsoft Internet Information Services 8.5
    #Version: 1.0
    #Date: 2021-05-10 00:00:03
    #Fields:
    Attached Files Attached Files

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Power query import based on specific row

    That file seems to parse ok for me from row 5 using a tab delimiter, so I'd just remove the top 4 rows after loading and then rename the columns, assuming they are the same column names in every file?

  6. #6
    Registered User
    Join Date
    04-17-2020
    Location
    Newcastle
    MS-Off Ver
    office 365
    Posts
    66

    Re: Power query import based on specific row

    Thanks Rorya, yes that's right, i can manually remove them but i have to do this for a large number of files so was wondering if there's a way to configure that during the import, either when you import the data physically or when you import into the data model using powerquery (or some other function i'm not familiar with)

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Power query import based on specific row

    It’s a function in PQ: just click remove top rows, then specify 4 rows.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power Query - Import Error Help
    By Eggs Sell! in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2021, 03:21 AM
  2. How to import .pdf as .xls? (Power Query)
    By santinnn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-14-2020, 04:56 AM
  3. Extract specific rows based on criteria in power query
    By ronakchoudhary in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-31-2020, 05:02 PM
  4. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  5. Import txt file using power query
    By kv.singh in forum Excel General
    Replies: 6
    Last Post: 04-27-2020, 05:05 AM
  6. Power Query Import Question
    By Zandor435 in forum Excel General
    Replies: 1
    Last Post: 01-20-2020, 06:07 AM
  7. Power Query - Remove Specific Duplicate Rows (Based on sort criteria)
    By kersplash in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-22-2019, 03:30 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1