LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-25-2013, 08:55 AM   #1
sryzdn
Member
 
Registered: Feb 2013
Posts: 273

Rep: Reputation: 9
A question on scripting


Hi,

I have a txt file, as enclosed, full of numbers. Are there any commands I can use to get the numbers that are between, for example, -3.00 and 2.00?
Attached Files
File Type: txt numbers.txt (6.9 KB, 66 views)
 
Old 08-25-2013, 09:09 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,544

Rep: Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898
Probably look at something like Perl or Ruby would suit your needs.
 
Old 08-25-2013, 10:27 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,188

Rep: Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405Reputation: 4405
Quote:
Originally Posted by sryzdn View Post
Hi,

I have a txt file, as enclosed, full of numbers. Are there any commands I can use to get the numbers that are between, for example, -3.00 and 2.00?
Read the man page on the sort command. Pay particular attention to the "--general-numeric-sort" option.
:: edit ::
That will only sort the file. You will need a simple program of some sort...bash can do this in just a few lines. I would strip the 'header' column off on the left first, to avoid getting false data, though. There are many scripts you can find with a Google search if you try.

Last edited by TB0ne; 08-25-2013 at 10:31 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Scripting question krazykevin Programming 9 03-19-2008 01:40 PM
Yet another scripting question kinetik Linux - General 4 04-01-2006 12:30 PM
Scripting question msandford Linux - Newbie 4 09-05-2005 10:23 AM
scripting question gearoid Programming 3 05-26-2004 02:43 PM
scripting question cyph3r7 Linux - General 1 04-05-2004 02:12 PM

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

All times are GMT -5. The time now is 04:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration