Displaying TSV files

46 views
Skip to first unread message

Laurel Cooper

unread,
Mar 17, 2023, 6:48:56 PM3/17/23
to BBEdit Talk
I work with large, tsv-formatted text files The files are 17 column text files with the columns separated by tabs.  I need to be able to see that none of the tabs are missing.
I can see the tab stops by turning on "Show invisibles", but in some lines the tabs are basically on top of each other, and in other places, the text is on top of them. 
Is there a better way to display these files?
I took a screen shot as an example:
Thanks!

tsv.jpg

Rich Siegel

unread,
Mar 17, 2023, 6:52:08 PM3/17/23
to BBEdit Talk
On 17 Mar 2023, at 18:35, Laurel Cooper wrote:

> I work with large, tsv-formatted text files The files are 17 column text
> files with the columns separated by tabs. I need to be able to see that
> none of the tabs are missing.
> I can see the tab stops by turning on "Show invisibles", but in some lines
> the tabs are basically on top of each other, and in other places, the text
> is on top of them.
> Is there a better way to display these files?

I recommend using BBEdit 14.6.x and a monospaced font; if you're using a pre-14.6 version, try updating and see how that works for you.

R.

Laurel Cooper

unread,
Mar 17, 2023, 8:13:25 PM3/17/23
to bbe...@googlegroups.com
Thanks!  I am on version 14.6.4
I tried changing it to Courier font and that is actually much easier to read. 
Laurel

On 3/17/23 3:52 PM, Rich Siegel wrote:
[This email originated from outside of OSU. Use caution with links and attachments.]

On 17 Mar 2023, at 18:35, Laurel Cooper wrote:

I recommend using BBEdit 14.6.x and a monospaced font; if you're using a pre-14.6 version, try updating and see how that works for you.

R.

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fbbedit&data=05%7C01%7Ccooperl%40oregonstate.edu%7Ca5b0447f88644cdb806108db273a3de8%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638146903320573795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1NYF7wO3LSdDOWPR9uX9f9uiKeaAMsaK3D6r1VsbgS4%3D&reserved=0>
---
You received this message because you are subscribed to a topic in the Google Groups "BBEdit Talk" group.
To unsubscribe from this topic, visit https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Ftopic%2Fbbedit%2F0YzW2hob050%2Funsubscribe&data=05%7C01%7Ccooperl%40oregonstate.edu%7Ca5b0447f88644cdb806108db273a3de8%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638146903320573795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6hB8PI1KKJGoht1uq4XQT%2BNPlAy4J%2F9y1GxW51bnTIw%3D&reserved=0.
To unsubscribe from this group and all its topics, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fbbedit%2F297AB881-F0D7-4591-B401-8619F17B0C56%2540barebones.com&data=05%7C01%7Ccooperl%40oregonstate.edu%7Ca5b0447f88644cdb806108db273a3de8%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638146903320573795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=my6v6I7SLwXaEhUQJHZN4k%2B40ZmerXf82vqB%2BPFPjkQ%3D&reserved=0.

-- 
Laurel Cooper
Dept. of Botany and Plant Pathology
2503 Cordley Hall
Oregon State University
Corvallis, OR 97331

Bruce Van Allen

unread,
Mar 17, 2023, 8:19:41 PM3/17/23
to bbe...@googlegroups.com
In addition to Rich’s suggestion, you could set tab width to a larger-than-normal size, to put more space between columns.

I have a little utility written in Applescript, saved in BBEdit’s Scripts folder, that adds 12 spacebar spaces to the tab width. Successive calls to the script keep widening the tabs until they hit a maximum (64 spaces), at which it reverts to standard 4 spaces per tab.

tell application “BBEdit"
set tabW to tab width of text window 1
if tabW > 64 then
set tabW to 4
else
set tabW to tabW + 12
end if
set tab width of text window 1 to tabW
end tell

I assign a keyboard combo to the script (in BBEdit’s Menus and Shortcuts settings/preferences), so I can quickly space out some columns to more clearly view the data.

Changing BBEdit’s tab width doesn’t change the file, just the view in BBEdit.

Also check out the Edit -> Columns menu, which allows selecting and manipulating whole columns. Sometimes a column selection will reveal a problem.

Another approach, which you might prefer over visually inspecting your files, would be a script that checks every line to be sure there are correct number of columns (or tabs). The core of such a script could be a regular expression that assumes the correct number of columns; if you search on it BBEdit, you’ll get a results window with the number of records/lines found - if that’s not the same as the number of lines in the file, you’ll need to check the file. A more elaborate script could pull out the errant lines for you...


— Bruce

_bruce__van_allen__santa_cruz_ca_
> <tsv.jpg>
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://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 view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/a0702843-bbee-486f-a828-0bb6faff8d51n%40googlegroups.com.
> <tsv.jpg>

Neil Faiman

unread,
Mar 18, 2023, 9:59:57 AM3/18/23
to BBEdit Talk Mailing List
If your goal is, very specifically, to be sure that every line in your file has 17 tabs in it, there is a simple solution.

From the BBEdit Text menu, choose “Process lines containing…”.

Choose the “Find lines that … do not contain: option.
In the search field, enter

([^\t]*\t){17}

Check the Grep option, choose your preferred result options, and click Process. You will get a list (or report, or whatever) of all the lines in your file that don’t contain 17 tabs.

Cheers,
Neil Faiman

Greg Raven

unread,
Mar 23, 2023, 8:35:00 AM3/23/23
to BBEdit Talk
I may be missing something, but when I need to do something along these lines I open in Numbers (or Excel), which allows an immediate visual confirmation of column integrity. 
Reply all
Reply to author
Forward
0 new messages