You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current script reads a CSV with multiple columns. The columns are defined in the class constants. From the fact that it uses a combiner class, I assumed that at any point a bach of csv's need to be merged using a unique column. I think you have multiple CSV types for each customer/campaign and you need to make a single CSV with all the data. Maybe multiple exports from a third party source.
6
+
The script checks a folder for the files that matche the name inputed and then sorts them by the date parsed from the file name.
7
+
Since your code initially had only one file as a param for the combine method from the Combiner class, I assumed that i could work for now with just one CSV source, so i created one for tests.
8
+
You create a hash with the keys being the headers of the CSV files and the values being an array of all the values.
9
+
You now have an enumerator with as many elements as there are lines in the CSV.
10
+
Then, for each of the elements in the enumerator, you output it into the destination CSV, making sure you divide the total rows using the LINES_PER_FILE value.
11
+
You used the combine_values method to change some of the values depending on calculations needed by the business logic.
Account ID Account Name Campaign Ad Group Keyword Keyword Type Subid Paused Max CPC Keyword Unique ID ACCOUNT CAMPAIGN BRAND BRAND+CATEGORY ADGROUP KEYWORD Last Avg CPC Last Avg Pos Clicks Impressions ACCOUNT - Clicks CAMPAIGN - Clicks BRAND - Clicks BRAND+CATEGORY - Clicks ADGROUP - Clicks KEYWORD - Clicks Avg CPC CTR Est EPC newBid Costs Avg Pos number of commissions Commission Value ACCOUNT - Commission Value CAMPAIGN - Commission Value BRAND - Commission Value BRAND+CATEGORY - Commission Value ADGROUP - Commission Value KEYWORD - Commission Value
Account ID Account Name Campaign Ad Group Keyword Keyword Type Subid Paused Max CPC Keyword Unique ID ACCOUNT CAMPAIGN BRAND BRAND+CATEGORY ADGROUP KEYWORD Last Avg CPC Last Avg Pos Clicks Impressions ACCOUNT - Clicks CAMPAIGN - Clicks BRAND - Clicks BRAND+CATEGORY - Clicks ADGROUP - Clicks KEYWORD - Clicks Avg CPC CTR Est EPC newBid Costs Avg Pos number of commissions Commission Value ACCOUNT - Commission Value CAMPAIGN - Commission Value BRAND - Commission Value BRAND+CATEGORY - Commission Value ADGROUP - Commission Value KEYWORD - Commission Value
Account ID Account Name Campaign Ad Group Keyword Keyword Type Subid Paused Max CPC Keyword Unique ID ACCOUNT CAMPAIGN BRAND BRAND+CATEGORY ADGROUP KEYWORD Last Avg CPC Last Avg Pos Clicks Impressions ACCOUNT - Clicks CAMPAIGN - Clicks BRAND - Clicks BRAND+CATEGORY - Clicks ADGROUP - Clicks KEYWORD - Clicks Avg CPC CTR Est EPC newBid Costs Avg Pos number of commissions Commission Value ACCOUNT - Commission Value CAMPAIGN - Commission Value BRAND - Commission Value BRAND+CATEGORY - Commission Value ADGROUP - Commission Value KEYWORD - Commission Value
0 commit comments