Last active
February 2, 2024 14:29
-
-
Save deldersveld/5bf69c52601a11d6b843c8438cc3c7b7 to your computer and use it in GitHub Desktop.
American Time Use Survey - Activity Lexicon from PDF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
FilePath = "[replace with folder path]\tabula-lexiconnoex0315.csv", | |
Source = Csv.Document(File.Contents(FilePath),[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.Csv]), | |
#"Removed Top Rows" = Table.Skip(Source,1), | |
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]), | |
#"Filtered Rows" = Table.SelectRows(#"Promoted Headers", each ([#"Major #(cr)category"] <> "ATUS 2003-2015 Activity coding lexicon" and [#"Major #(cr)category"] <> "Major #(cr)category")), | |
#"Replaced Value" = Table.ReplaceValue(#"Filtered Rows","",null,Replacer.ReplaceValue,{"Major #(cr)category", "First and #(cr)second-tier #(cr)categories"}), | |
#"Filled Down" = Table.FillDown(#"Replaced Value",{"Major #(cr)category", "First and #(cr)second-tier #(cr)categories"}), | |
#"Filtered Rows1" = Table.SelectRows(#"Filled Down", each ([#"6-digit #(cr)activity #(cr)code"] <> "")), | |
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows1",{"", "_1"}) | |
in | |
#"Removed Columns" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a great job.