Hot answers tagged

30

You'll need more than the cat command, as described here: Say you have 3 CSV-files: file1.csv, file2.csv, and file3.csv and want to join them to bigfile.csv and your header is always (only) the first line, then use either (keep header from first file "file1.csv"): cat file1.csv <(tail +2 file2.csv) <(tail +2 file3.csv) > bigfile.csv or (remove ...


17

Make sure all the columns you want metadata for are visible in the playlist or library you're looking at. Then, select the tunes you want with shift-click or ⌘-click or whatever: Then, hit ⌘+C to copy. This will allow you to paste what's visible in the iTunes playlist into any sort of spreadsheet you like: It won't label the columns for you, but it'll do ...


12

You can do File -> Library -> Export Library and get an XML file of your library metadata. From there it would be a relatively straightforward matter for a programmer to convert the XML data into a CSV, spreadsheet, or database. For example, I made this quick Ruby script in about 10 minutes to get the artist, album, and track names from the XML and output a ...


11

I agree with the top answer but I suggest to extend it with the following scenario (as I can not comment): If you want the output file to contain header (once) the correct script is: awk '(NR == 1) || (FNR > 1)' file*.csv > bigfile.csv FNR represents the number of the processed record in a single file. And NR represents it globally, so first line is ...


10

In Numbers you can use any separator when importing csv tables. On the format sidebar, in the table tab, look for adjust Import settings. Inside it you have delimited options where you can even use custom delimiters


8

Google Docs I just used Google Docs for exactly this purpose but all I needed to do was extract a column of email addresses from a CSV file. Note: Google Docs has file size limits, so this is not a silver bullet. A great bullet, but those limitations are critical when applied.


7

Table Tool Free and Open Source (MIT License). Table Tool opens CSV files. It auto-detects character encoding and record separator (comma/semicolon/tab), and supports basic editing operations (like add row, delete row, add column delete column etc). Table Tool can convert files to a different format. Table Tool is also available on the Mac App Store.


6

You could also use a group command ({ ; }) instead of process substitution (<()): { head -n1 file1.csv; for f in file*.csv; do tail -n+2 "$f"; done; } > new.csv It also works with CRLF line endings as long as the files end with an empty line (\r\n). The number-only versions of head and tail were made obsolete by POSIX 1003.1-2001, and they result in ...


6

Numbers Disclaimer: Free on new Macs Apple Numbers also opens and saves to CSV. Just had to add to the list. Numbers: Save as CSV after editing: Note that you can choose text encoding as well when exporting if needed for other systems.


6

LibreOffice LibreOffice does quite a good job now and is compatible even with OS X 10.9


6

So the Apple thread recommended changing the txt to csv. This didn't work, my file was already csv, properly formated etc. No, changing to txt did the trick. I'm finding it harder and harder to recommend switching from Microsoft to Apple. This sort thing just shouldn't be happening.


4

DB Browser for SQLite Not an obvious candidate but very powerful (and free). Steps Create an empty Database Import Table form CSV file With various import options Edit, search, plot the data Export your edits as (new) CSV file


4

I have faced a similar problem: after exporting a csv file from MySQL I tried to open directly into Numbers but it did not open correctly so I tried to drag the file onto an open sheet and it also and did not work. Then I read lot of things on Internet about how Numbers deals with comma, so I exported the data once again switching comma (,) for semicolon (;)...


4

Simple solution for getting a csv file to open correctly on a Mac. Change the csv file extension to txt. Then right click on it and open with Numbers.


4

For Excel V15, use a posix path, like this: set theOutputPath to POSIX path of ((path to desktop folder as string) & "My Saved Workbook.csv") tell application "Microsoft Excel" tell active workbook save workbook as filename theOutputPath file format CSV Mac file format with overwrite end tell end tell Edit 1 - I test it on V15.15 and ...


3

If you're willing to move away from Excel, you could try using OpenOffice or LibreOffice to create .csv files. They're both free, they both have most of the functionality included in Excel, and they both allow tabulated data to be saved as a .csv file using any character as a data separator or text delimiter (including the pipe, of course).


3

For enhancements/tools to work with ITunes probably the first place to go is Doug's Applescripts for iTunes. There are many useful scripts here. On the page for Exporting Info there is this script that exports track information as a text file. This script will write a discrete alphabetical list of your choice of the Albums, Artists, Album Artists, ...


3

Here's a way to force any app to open any document : Make sure your Dock is visible. Select your .csv file in the Finder Grab it with your mouse and move it over the Excel icon in the Dock. Do not release the mouse button. Hold the Command and the Alt key on your keyboard Release the mouse button.


3

csveditor (Java) Very simple (no undo), java program (some may stop reading here ;) - does the job You have to create an empty table upon launch but then you can open any file. Screenshot:


3

Dragging and dropping a CSV onto a table works again since v3.2! Currently in v6, I find that I can drag data onto an existing table, but it will overwrite the table's contents. To preserve existing rows: select the file in Finder and Copy select the target cell in your target table (usually the last row in column A) Paste When selecting the target cell, ...


2

OpenRefine When interacting with large and messy text csv and other structured text files, I now typically go to Google Refine (now called OpenRefine). I've used it for TSV/CSV, JSON, and XML documents. In my experience it crashes rarely, and is pretty good for mangling data (you can apply transformations with scripting languages). Its approach is more ...


2

Free Microsoft Office Online What better product than Excel is there to open and manipulate CSV files? With this option, you don't need to install anything. It has the convenience of Google Docs but the guaranteed compatibility of MS Office.


2

Needed to concatenate two large CSVs with identical columns into larger CSV for chunking script (data does not have unique id's). First took header out of second csv awk 'FNR > 1' file2.csv > file2_noheading.csv Next, concatenated via the following cat file1.csv file2_noheading.csv > newfile.csv


2

Use 'tab' delimited fields - works perfectly.


2

Rename the file extension to .csv then open the file with Numbers.


2

Three sources I've poured over when developing my own processes for importing users include: http://support.apple.com/kb/PH15663 and the man pages for dsimport and dsexport. For OD, it appears you have to define the format of the file you're using to import records. While the help page above indicates there are a handful of required attributes, I found I ...


2

A pickle indeed, data sanitizing is no fun and you have a doozy. If you have access to his iCloud account you can go into contacts, select all of them and click on the gear icon to export them. I do believe that Apple only lets you export as a vCard. I do believe there are a number of utilities that convert vcards to another format, some of them online. ...


2

I am simply trying to convert a .txt file to a .csv, without losing the contents of that document You can just change the extension .txt into .csv. 'Comma separated value' files are just plain text files with the data columns separated by comma's (or ; or tab). 'txt' files are meant for text, and 'csv' files are ment for data storage, but it are both just ...


2

You can use write a script to read your two column CSV file, and then convert it into a list where you'd have one list item for every row in your CSV file, and every list item would itself be a list (column A value, column B value). So, if your CSV file looked like this: red,apple yellow,banana green,pickle brown,desk white,sock It would be converted it to ...


Only top voted, non community-wiki answers of a minimum length are eligible