LinuxQuestions.org
Visit Jeremy's Blog.
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 12-11-2017, 11:46 AM   #1
pyramid.122
LQ Newbie
 
Registered: Dec 2017
Posts: 1

Rep: Reputation: Disabled
How to increase the total number of columns in a text file


Hi all

I need to increase the increase the number of columns in my .txt file.

Thanks;
Pyramid
 
Old 12-11-2017, 12:14 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Add more information to the end of each line.

You'll need to post a representative output of some lines of your file and also what you wish to do.

Finally you'll need to indicate what your constraints are, such as you need to try to do this from the shell, or some other means.

Please review some of the advice here to help you learn how to write a better question to allow people to help you better.
 
1 members found this post helpful.
Old 12-11-2017, 12:16 PM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ +1, text files by definition are ascii binary streams with an infinite amount of columns (bytes) record-terminated by ascii-10.
 
Old 12-11-2017, 04:51 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Perhaps the OP should look at the 'paste' command.
 
Old 12-12-2017, 09:38 AM   #5
giis
Member
 
Registered: Nov 2013
Location: Third Rock from Moon
Distribution: RPM/DEB based and LFS
Posts: 73

Rep: Reputation: Disabled
Agree with allend, check out paste command.

example:
Quote:
$cat file1
line1 col1 col2
line2 col1 col2
line3 col1 col2
$ cat file2
col3
clo3
clo3
$ paste file1 file2
line1 col1 col2 col3
line2 col1 col2 clo3
line3 col1 col2 clo3
 
  


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
increase number of file seighalani Linux - Server 1 08-23-2015 12:26 PM
average of two columns in text file bala06 Programming 8 09-09-2014 11:40 AM
How to check the total number of columns in a text file cliffyao Linux - Newbie 9 12-01-2009 04:49 PM
Increase text line number per screen ? Vilius Slackware 3 02-12-2009 09:21 AM
How can I see the total number of file locks being currently used? abefroman Linux - Software 1 11-08-2005 06:16 PM

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

All times are GMT -5. The time now is 05:49 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