伙计们!
我正在尝试使用以下命令将此csv文件导入mysql:
加载数据本地文件'/var/www/ads/reporting-x.csv'到表'ads_data'字段以','结尾 忽略1行
Reporting Starts,Reporting Ends,Page Likes,Post Reactions,Post Comments,Post Shares,Photo Views,Clicks to Play Video,Link Clicks,Offers Saved,Desktop App Installs,Desktop App Uses,Check-Ins,Desktop App Credit Spends,Question Follows,Question Answers,Page Mentions,Gift Sales,Leads (Form),Game Plays,Mobile App Event,Mobile App Installs,Event Responses,Page Tab Views,Mobile App Sessions,Mobile App Registrations Completed,Mobile App Content Views,Mobile App Day 2 Retention,Mobile App Day 7 Retention,Mobile App Searches,Mobile App Ratings Submitted,Mobile App Tutorials Completed,Mobile App Adds to Cart,Mobile App Adds to Wishlist,Mobile App Checkouts Initiated,Mobile App Adds of Payment Info,Mobile App Purchases,Mobile App Levels Completed,Mobile App Achievements Unlocked,Mobile App Credits Spent,Other Mobile App Actions,Other Actions,Offline Purchases,Offline Adds of Payment Info,Offline Adds to Cart,Offline Adds to Wishlist,Offline Registrations Completed,Offline Checkouts Initiated,Offline Leads,Offline Other Conversions,Offline Searches,Offline Content Views,Website Checkouts (Conversion Tracking Pixel),Website Registrations (Conversion Tracking Pixel),Website Leads (Conversion Tracking Pixel),Website Adds to Cart (Conversion Tracking Pixel),Website Key Page Views (Conversion Tracking Pixel),Other Website Conversions (Conversion Tracking Pixel),Newly Purchased Mobile Devices,Desktop App Engagement,Desktop App Story Engagement,Page Engagement,Post Engagement,Website Conversions,Mobile App Actions,3-Second Video Views,Offline Actions (All),Landing Page Views,Commerce Actions,Adds to Cart (Commerce),Messages to Buy (Commerce),Other Commerce Actions,Purchases (Commerce),Product Views (Commerce),Post Dwells,100% In-View Impressions,Attention Impressions,Blocked Messaging Conversations,Messaging Replies,Messaging Conversations Started,New Messaging Conversations,On-Facebook Workflow Completion,On-Facebook Purchases,Referral Invites,Referral Invite Messages,On-Facebook Add to Cart,On-Facebook Message To Buy,On-Facebook View Content,Website Adds of Payment Info,Website Adds to Cart,Website Adds to Wishlist,Website Registrations Completed,Website Checkouts Initiated,Website Leads,Website Purchases,Website Searches,Website Content Views,Contacts,Products Customized,Donations,Location Searches,Appointments Scheduled,Subscriptions,Applications Submitted,Trials Started,Adds to Cart,Adds to Wishlist,Adds of Payment Info,Leads,Searches,Checkouts Initiated,Registrations Completed,Content Views,Purchases,App Activations,App Installs,Achievements Unlocked,Levels Achieved,Ratings Submitted,Credit Spends,Tutorials Completed,Account ID,Account Name,Clicks (All),Frequency,Impressions
42717,43341,6649,49912,2735,5780,11948,,202576,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,282563,275914,228303,,2959,,90169,,,,,,,,,,,,,,,,,,,,,,22325,,392,3467,64,2125,19893,180037,,,,,,,,,,,,,,,,,,,,,,,,,1230665053638498,"Loja",313486,8,830745,9821140
文件已导入,很酷,但是 mysql正在更改位置,将列向右移。
如果我使用Libreoffice打开文件,则可以正确的方式获取列。但是,如果我导入,则一列中的数据将转到下一列。
我认为这是空值列的问题
上面的 CSV 来自Facebook Ads,我无法通过更改扩展名或在字段中添加引号来下载它。
是否有任何 LOAD DATA LOCAL INFILE 属性可以解决我的问题?
请记住,这些列是动态的,因此我将其用于几个不同的文件(与其他列),因此对于x列中是否包含信息,我将很难验证,因为我不知道它是否会返回空的。
****,但是在mysql中,我在“帐户名称”中看到“帐户ID”的值。***