Viewing CSV Files in BBEdit - How to Automatically Visually Format Columns

3,397 views
Skip to first unread message

Adam Wise

unread,
Feb 23, 2016, 9:42:37 AM2/23/16
to BBEdit Talk
Forgive this question because I think its been answered in parts in the forum previously & I have very limited experience with BBEdit but I was hoping someone could guide me in the right direction.  I'm editing a lot of delimited files in BBEdit & was hoping there was a way to space out columns & align them so they look more like an excel sheet....for instance:

Name, City, Zip
John Doe, Washington, 20005

to

Name                 City                      Zip
John Doe           Washington         20005

Thank you.

Bucky Junior

unread,
Feb 23, 2016, 10:25:22 AM2/23/16
to bbe...@googlegroups.com
How about ->Preferences ->Editor Defaults … at the bottom “Tab Width”.

You cannot set different tab widths so all tab widths are the same and apparently applies to all documents although very easy to reset.


--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.

Christopher Stone

unread,
Feb 23, 2016, 3:19:16 PM2/23/16
to BBEdit-Talk
On Feb 23, 2016, at 08:39, Adam Wise <a...@adamwi.se> wrote:
I'm editing a lot of delimited files in BBEdit & was hoping there was a way to space out columns & align them so they look more like an excel sheet...
______________________________________________________________________

Hey Adam,

As Bucky mentions BBEdit does not have variable tab widths.

However you can set the width of fixed tabs on a per document basis with AppleScript.

tell application "BBEdit"
  tell front text window
    set tab width to 10
  end tell
end tell

I do quit a lot of work with delimited data, and I often want to see it in tabular format.

To do that I usually run a Text Filter.

#!/usr/bin/env bash
column -t -s',';

* The comma in this case is the delimiter.

Your original text:

Name, City, Zip
John Doe, Washington, 20005

Expands to this:

Name       City         Zip
John Doe   Washington   20005

The spacing between columns will be a minimum of 2 spaces but will expand as necessary to align the columns.

See “man column” in the Terminal.app for an explanation of the parameters.

Text filters are installed here:

~/Library/Application Support/BBEdit/Text Filters/

(Create the folder if it does not already exist.)

See “Text filters” in the BBEdit User Manual for more information.

--
Best Regards,
Chris

Jeffrey Jones

unread,
Feb 23, 2016, 4:06:27 PM2/23/16
to bbe...@googlegroups.com
On Feb 23, 2016, at 10:25 AM, Bucky Junior <buckyju...@gmail.com> wrote:

You cannot set different tab widths so all tab widths are the same and apparently applies to all documents although very easy to reset.

You can set tab width for the current document in the Fonts panel: View > Text Display > Show Fonts. There is a Tab Width setting at the bottom of the panel. It applies only to the current document.

Mike Warren

unread,
Feb 23, 2016, 6:55:33 PM2/23/16
to bbe...@googlegroups.com
I’ve never looked for a BBEdit solution for editing delimited files and will be curious to see the solutions people here suggest.

For editing CSV files I recommend DB-Text, an app from Tension Software which is available in the Mac App Store ($9.99). I use DB-Text to maintain a tab-delimited, Russian-English dictionary file which is now 4 columns by 12225 rows. DB-Text loads my file instantly, has good import/export features, sorts by column, and remembers the last used column widths. When you search the files, it shows only the rows that match the search term. The software developer has responded to my questions and suggestions and has recently issued a maintenance update.

Reply all
Reply to author
Forward
0 new messages