-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macOS provides CSV Quick Look previews out of the box (even without Numbers being installed).
- Loading branch information
1 parent
013e949
commit 8cca348
Showing
6 changed files
with
51 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Cocoa | ||
import Foundation | ||
import os.log | ||
import SwiftCSV | ||
|
||
/// View controller for previewing TSV files | ||
class TSVPreviewVC: TablePreviewVC, PreviewVC { | ||
func loadPreview() throws { | ||
// Read and parse TSV file | ||
var csv: CSV | ||
do { | ||
csv = try CSV(url: file.url, delimiter: "\t") | ||
} catch { | ||
os_log( | ||
"Could not parse TSV file: %{public}s", | ||
log: Log.parse, | ||
type: .error, | ||
error.localizedDescription | ||
) | ||
throw error | ||
} | ||
|
||
loadData(tableData: csv.namedRows) | ||
} | ||
} |
This file contains 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