SOLVED

Help with CSV into Excel for Mac

%3CLINGO-SUB%20id%3D%22lingo-sub-2059541%22%20slang%3D%22en-US%22%3EHelp%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2059541%22%20slang%3D%22en-US%22%3E%3CP%3EI%20use%20Excel%20for%20Mac%20and%20I%20tried%20to%20import%20a%20CSV%20file%20using%20the%20%22Get%20External%20Data%22%20option.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20problem%20is%20I%20cannot%20seem%20to%20get%20the%20original%20CSV%20into%20the%20correct%20format%20to%20be%20displayed.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EDoes%20anyone%20know%20what%20options%20to%20select%20in%20the%20process%20to%20make%20sure%20MS%20knows%20what%20I%20need%20done%20to%20the%20CSV%20text.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20enclosed%20the%20original%20CSV%20and%20the%20result.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThere%20are%20too%20many%20permutations%20for%20me%20to%20go%20through%20!%3CBR%20%2F%3E%3CBR%20%2F%3EHelp.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2059541%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2059885%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2059885%22%20slang%3D%22en-US%22%3E%3CP%3Eoh.%20I%20see%20what%20happening.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20exported%20CSV%20has%20one%20field%20with%20multiple%20entries%20separated%20by%20commas.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20fields%20are%20also%20separated%20by%20commas.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20in%20the%20import%20MS%20cannot%20see%20these%20as%20different%20obviously.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EDoes%20anyone%20have%20a%20solution%2C%20since%20I%20have%20no%20control%20over%20the%20format%20of%20the%20exported%20CSV%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks!%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2060023%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2060023%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F915784%22%20target%3D%22_blank%22%3E%40twwareza%3C%2FA%3E%26nbsp%3BFirst%2C%20I%20opened%20the%20csv%20from%20within%20Excel%20(like%20you%2C%20also%20on%20a%20Mac)%20and%20applied%20Text-to-columns%2C%20resulting%20in%20a%20mess.%20Threw%20it%20all%20away%20and%20opened%20the%20csv%20file%20by%20double%20clicking%20it%20in%20its%20folder.%20Excel%20opened%20it%20without%20problems.%20See%20attached.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2063219%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063219%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B-%20hey%20thanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYah.%20That%20works%20-%20even%20via%20Numbers%20when%20double%20click%20from%20the%20folder.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20trying%20to%20work%20out%20a%20way%20to%20automate%20some%20reports%20and%20need%20to%20be%20able%20to%20read%20the%20CSV%20via%20Get%20Data%20in%20Excel.%20This%20way%2C%20all%20new%20data%20will%20be%20populated%20via%20CSVs.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20also%20could%20not%20find%20a%20way%20to%20connect%20a%20folder%20of%20excel%20files%20as%20I%20did%20not%20see%20a%20get%20option%20for%20this.%20Is%20this%20possible%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3CBR%20%2F%3E%3CBR%20%2F%3EReza%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2063442%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063442%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F915784%22%20target%3D%22_blank%22%3E%40twwareza%3C%2FA%3E%26nbsp%3BPerhaps%20you%20already%20figured%20it%20out%2C%20but%20just%20in%20case%20you%20haven't.%20Your%20csv-data%20contains%20files%20with%20line%20break%20and%20fields%20with%20%22%22%20(i.e.%20nothing).%20See%20pictures%20below.%20Excel%20doesn't%20handle%20these%20properly%20when%20you%20use%20the%20text%2Fcsv%20import%20wizard.%20Don't%20ask%20me%20why%2C%20I'm%20not%20an%20expert%20in%20that%20area.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-01-15%20at%2008.00.13.png%22%20style%3D%22width%3A%20485px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F246627i81A72107FE6F1AAE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-01-15%20at%2008.00.13.png%22%20alt%3D%22Screenshot%202021-01-15%20at%2008.00.13.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-01-15%20at%2008.03.15.png%22%20style%3D%22width%3A%2066px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F246626i573F8024B462F3CD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-01-15%20at%2008.03.15.png%22%20alt%3D%22Screenshot%202021-01-15%20at%2008.03.15.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EOpen%20the%20csv%20in%20the%20TextEdit%20app%20on%20your%20Mac%20and%20do%20a%20Find%20off%20line%20feeds%20(type%20Alt-Enter%20in%20the%20Find%20field%20and%20type%20a%20space%20in%20the%20Replace%20field.%20Press%20Replace%20All.)%20Then%2C%20also%20replace%20all%20quotation%20marks%20with%20%26nbsp%3Bnothing.%20Save%20the%20file%20(with%20a%20different%20name%2C%20to%20be%20safe)%20and%20now%20import%20the%20new%20file%20into%20Excel.%20Added%20a%20cleaned%20csv%20file%20and%20the%20resulting%20xlsx%20after%20import.%20Can%20you%20automate%20these%20steps%3F%20Probably%20yes%2C%20but%20I%20can't%20help%20you%20with%20that.%20There%20are%20resources%20on%20the%20web%20that%20explain%20how%20to%20do%20this%20with%20VBA%2C%20though.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%2C%20you%20mention%20that%20you%20can't%20find%20how%20to%20connect%20to%20a%20folder.%20I'm%20afraid%2C%20that%20comes%20with%20%22Get%20and%20Transform%20Data%22%2C%20a.k.a.%20Power%20Query%20which%20is%20NOT%20available%20for%20Mac%20users.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2063483%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063483%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3Boh%20you%20are%20a%20star.%20Thank%20you.%20Thank%20you.%20I%20did%20not%20know%20how%20to%20do%20that.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20now%20see%20the%20need%20to%20get%20Windows%20installed%20as%20this%20power%20query%20function%20seems%20to%20make%20reporting%20lighter%20work!%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20again.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EReza%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2063516%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20CSV%20into%20Excel%20for%20Mac%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063516%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F915784%22%20target%3D%22_blank%22%3E%40twwareza%3C%2FA%3E%26nbsp%3BYou're%20welcome!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I use Excel for Mac and I tried to import a CSV file using the "Get External Data" option. 

My problem is I cannot seem to get the original CSV into the correct format to be displayed. 

Does anyone know what options to select in the process to make sure MS knows what I need done to the CSV text. 

I have enclosed the original CSV and the result. 

There are too many permutations for me to go through !

Help. 


6 Replies

oh. I see what happening. 

The exported CSV has one field with multiple entries separated by commas. 

The fields are also separated by commas. 

So in the import MS cannot see these as different obviously. 

Does anyone have a solution, since I have no control over the format of the exported CSV?

Thanks!


 

@twwareza First, I opened the csv from within Excel (like you, also on a Mac) and applied Text-to-columns, resulting in a mess. Threw it all away and opened the csv file by double clicking it in its folder. Excel opened it without problems. See attached.

@Riny_van_Eekelen - hey thanks!

 

Yah. That works - even via Numbers when double click from the folder. 

I am trying to work out a way to automate some reports and need to be able to read the CSV via Get Data in Excel. This way, all new data will be populated via CSVs. 

I also could not find a way to connect a folder of excel files as I did not see a get option for this. Is this possible?

Thanks

Reza


best response confirmed by twwareza (Occasional Contributor)
Solution

@twwareza Perhaps you already figured it out, but just in case you haven't. Your csv-data contains files with line break and fields with "" (i.e. nothing). See pictures below. Excel doesn't handle these properly when you use the text/csv import wizard. Don't ask me why, I'm not an expert in that area.

 

Screenshot 2021-01-15 at 08.00.13.png

 

Screenshot 2021-01-15 at 08.03.15.png

Open the csv in the TextEdit app on your Mac and do a Find off line feeds (type Alt-Enter in the Find field and type a space in the Replace field. Press Replace All.) Then, also replace all quotation marks with  nothing. Save the file (with a different name, to be safe) and now import the new file into Excel. Added a cleaned csv file and the resulting xlsx after import. Can you automate these steps? Probably yes, but I can't help you with that. There are resources on the web that explain how to do this with VBA, though.

 

Then, you mention that you can't find how to connect to a folder. I'm afraid, that comes with "Get and Transform Data", a.k.a. Power Query which is NOT available for Mac users.

@Riny_van_Eekelen oh you are a star. Thank you. Thank you. I did not know how to do that.

I now see the need to get Windows installed as this power query function seems to make reporting lighter work!

Thanks again. 

Reza

@twwareza You're welcome!