LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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


Closed Thread
  Search this Thread
Old 08-02-2018, 01:13 PM   #1
d.mintis
LQ Newbie
 
Registered: Aug 2018
Posts: 4

Rep: Reputation: Disabled
numerical pattern using awk in bash


write the following numerical pattern (in column) in file 1

1 2 4 5 7 8 10 11
 
Old 08-02-2018, 01:25 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Why awk and not sed or tr? Why bash and not zsh or ksh? What have you written so far and where are you stuck? Which class is this homework for?
 
Old 08-02-2018, 01:29 PM   #3
d.mintis
LQ Newbie
 
Registered: Aug 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
I have little experience with awk, any help is appreciated
 
Old 08-02-2018, 01:35 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
There are many ways to do it, even in awk. One way would be to take a look at the Field Separator and the Output Field Separator. See "man awk" plus any number of tutorials.

However, it would help if you could explain what you have tried so far using awk and where you are stuck. Plus for context it would help to know why awk and not sed or tr, why bash and not zsh or ksh, and which class is this homework for?

We don't do homework.

Lastly, please review : https://www.linuxquestions.org/linux...Ask_a_Question
 
Old 08-02-2018, 01:43 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by d.mintis View Post
I have little experience with awk, any help is appreciated
Duplicate of: https://www.linuxquestions.org/quest...rn-4175635532/

Thread reported.
 
Old 08-02-2018, 02:10 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place.

This thread is being closed because it is a duplicate.

Please continue to follow up with your questions using your other thread.

https://www.linuxquestions.org/quest...rn-4175635532/

Please also refer to this link about How to use Linux Questions to learn about how best to frame your questions.

Be aware also of the LQ Rules such as the ones citing:
  • Do not post the same discussion multiple times. Duplicate discussions can be frustrating for other members. Try and pick the most relevant forum for your post. If you are unsure put it in Linux - General.
  • Do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and searches) and we'll do our best to help. Keep in mind that your instructor might also be an LQ member.
 
  


Closed Thread



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
[SOLVED] sed or awk to remove $8 in a | delimited file if non-numerical value exists BludGeonT Programming 5 06-21-2013 11:57 PM
numerical operation on selected lines and column using AWK program vjramana Linux - Newbie 3 05-16-2010 11:43 PM
[SOLVED] /bin/bash if statement pattern search, end of pattern special character? headhunter_unit23 Programming 3 04-29-2010 08:05 AM
Text file manipulation: Extracting specific rows according to numerical pattern CHARL0TTE Linux - Newbie 3 10-07-2009 07:14 AM
awk command to multipy $(field) by numerical constant? johnpaulodonnell Linux - Newbie 3 01-31-2007 06:43 AM

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

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