LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2018, 08:37 PM   #1
scottietheking
LQ Newbie
 
Registered: Feb 2018
Posts: 3

Rep: Reputation: Disabled
creating a table in Linux


How do you create a table with basically 7 columns separated equally and about 7 rows within the command line in Linux? Basically a table 7 by 7.
 
Old 02-09-2018, 08:46 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,328
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I am hardly an expert in this, but a web search for "command line linux columns" turned up this: https://www.lifewire.com/file-conten...-linux-4018107
 
Old 02-10-2018, 01:34 AM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
"table" implies database to me. What database(s) do you have installed?
 
Old 02-10-2018, 01:44 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
... or maybe HTML .... ?
 
Old 02-10-2018, 04:03 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Code:
man column
column -tN 7 filename
 
Old 02-10-2018, 06:12 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Asking a question in just one line without providing the necessary information is better suited for Google than for LQ

jlinkels
 
Old 02-10-2018, 09:31 AM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Do you just want to pad things so it's evenly spaced?

TEMP="paddingpaddingpadding"$VAR1
echo -n $TEMP | tail -n 10
TEMP="paddingpaddingpadding"$VAR2
echo -n $TEMP | tail -n 10
TEMP="paddingpaddingpadding"$VAR3
echo -n $TEMP | tail -n 10
TEMP="paddingpaddingpadding"$VAR4
echo -n $TEMP | tail -n 10
TEMP="paddingpaddingpadding"$VAR5
echo -n $TEMP | tail -n 10
TEMP="paddingpaddingpadding"$VAR6
echo -n $TEMP | tail -n 10
TEMP="paddingpaddingpadding"$VAR7
echo $TEMP | tail -n 10

Where 10 is the number of chars and could be anything that makes sense $(( $(( $COLUMNS / 7 )) - 1 )).
 
Old 02-10-2018, 09:38 AM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,498

Rep: Reputation: Disabled
...or maybe even take a look at sc a text/command line spreadsheet......depending on what your end aim is.
http://www.linuxjournal.com/article/10699

Edit: If you were meaning a database table, then take a look at sqlite.
https://www.sqlite.org/

Last edited by fatmac; 02-10-2018 at 09:40 AM.
 
Old 02-11-2018, 06:47 PM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
OR do you want a 7 x 7 CSV ascii text "table" ?

libreoffice calc ( spreadsheet) will do that very easily

but this dose read like a paraphrased homework question

Last edited by John VV; 02-11-2018 at 06:48 PM.
 
Old 02-11-2018, 08:33 PM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
could be LibreOffice Cal, or some other type of spread sheet.

edit:
belay that I just read the post above me, after posting... lol
Code:
$ for ((j=1;j<8;j++)) do echo " $j|_|1|_|2|_|3|_|5|_|6|_|7|" ; done
 1|_|1|_|2|_|3|_|5|_|6|_|7|
 2|_|1|_|2|_|3|_|5|_|6|_|7|
 3|_|1|_|2|_|3|_|5|_|6|_|7|
 4|_|1|_|2|_|3|_|5|_|6|_|7|
 5|_|1|_|2|_|3|_|5|_|6|_|7|
 6|_|1|_|2|_|3|_|5|_|6|_|7|
 7|_|1|_|2|_|3|_|5|_|6|_|7|
7 long by 7 down

Last edited by BW-userx; 02-11-2018 at 08:51 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating partition table - do I need to format afterwards? cilbuper Linux - Hardware 5 03-13-2014 04:03 PM
Creating a condensed table from a pre-existing table in putty Deedee393 Linux - Newbie 3 05-16-2012 11:07 AM
creating table ilinuxnewbie Linux - Newbie 2 08-03-2009 11:15 PM
creating table headers in bash panchosansa Programming 3 10-16-2006 04:22 AM
Need help creating routing table on linux itrap2003 Linux - Networking 5 06-25-2004 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration