1

I have to create a table in troff, what I have:

.TS
tab(:);
c s s
c | c | c
l | l | n.
My Custome PC Specs
=
Component:Selection:Price
_
CPU:Intel Core i5-4690K 3.5GHz Quad-Core Processor:$219.99  
_
Motherboard:MSI Z97-GAMING 5 ATX LGA1150:$129.88
_
Memory:Corsair Vengeance Pro 16GB (2 x 8GB) DDR3-1866 Memory:$74.88 
_
Storage:Sandisk X110 128GB 2.5" Solid State Drive:FREE  
\^:Western Digital 1TB 3.5" 7200RPM Internal Hard Drive:$38.77  
_
Video Card:MSI GeForce GTX 970 4GD5T OC 4GB GDDR5:$289.99   
_
Case:Corsair Graphite Series 230T Orange ATX Mid Tower Case:$73.46
_
Power Supply:CorsairCX 750W 80+ Bronze Certified Semi-Modular ATX:$59.99
_
Optical Drive:Asus DRW-24B1ST/BLK/B/AS DVD/CD Writer:$12.89 
_
Operating System: Microsoft Windows 10 Pro OEM (64-bit):FREE
_
WAN: TP-Link TL-WN881ND 802.11b/g/n PCI-Express Wi-Fi Adapter:$18.89
_
Case Fan: Cooler Master SickleFlow 69.7 CFM 120mm Fan:$9.99
_
Monitor:Monoprice 12178 144Hz 24.0" Monitor:$229.99
_
Keyboard: Corsair Vengeance K70 Wired Gaming Keyboard:$119.99
_
Mouse: Razer DeathAdder 2013 Wired Optical Mouse:$59.99
_
Total: :$1,388.70
_
.TE

I try to execute by typing tbl [filename] | troff, but I am not getting the table, I've tried using other options but I'm not sure if I understand how troff works.

tk421
  • 5,775
  • 6
  • 23
  • 34
Jesse T
  • 21
  • 3
  • It's been a while since I've used `troff` etc. I don't recall lines with only `_`. Is that part of `tbl`? If I have messed up your data, you can click on the `edited .. ago` link above my name and "roll-back" my change. But I would recommend that you `edit` your post, delete the `tbl` data, paste it in fresh and use the `{}` tool at the top left of the edit box to keep the proper formatting as code/data/etc. Good luck. – shellter Apr 19 '16 at 02:59

1 Answers1

2

With GNU Troff, I have successfully processed your file using the following invocation:

groff -t -Tascii tbl.tr > tbl.txt

-t tells troff to use run the tbl preprocessor and -Tascii set the ascii output device, which produces plain text output.

Here are the first three lines of the result:

                                    My Custome PC Specs
-----------------+-----------------------------------------------------------+--------------
   Component     |                         Selection                         |    Price
-----------------+-----------------------------------------------------------+--------------
CPU              | Intel Core i5-4690K 3.5GHz Quad-Core Processor            |   $219.99
-----------------+-----------------------------------------------------------+--------------
Motherboard      | MSI Z97-GAMING 5 ATX LGA1150                              |   $129.88
-----------------+-----------------------------------------------------------+--------------

Your error came from ignorance of troff options. Please, peruse the corresponding section of the manual either for GNU Troff or for whatever other flavour you may be using.

The best source of help with GNU Troff is its mailing list.

Anton Shepelev
  • 922
  • 9
  • 19