Get string between minimum range value


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Get string between minimum range value
# 1  
Old 05-14-2012
Get string between minimum range value

Deal All,

I have millions of input file like this:

input 1:
Code:
disk   minimum
DISK01 5173
DISK02 5227
DISK03 5284
DISK04 5346
DISK05 5400
DISK06 5456
DISK07 5511
DISK08 5572
.
.
.

input 2:
Code:
range 5180-5300 
range 5200-5400 
range 5300-5500 
.
.
.
.

desired output:

Code:
range 5180-5300 DISK01-DISK03
range 5200-5400 DISK01-DISK05
range 5300-5500 DISK03-DISK06
.
.
.
.

From input 2 I need to get string (DISK) betwen minimum range value in input 1.

Thanks for advance,
# 2  
Old 05-14-2012
We need some focus here. If you literally have millions of files processing is going to take a very, very long time. This is because there are limits to memory when you use any app like awk or perl.

Approximately how many files are like input1?
What OS and shell are we using here?
# 3  
Old 05-15-2012
Hi Jim,

Each file like input 1 approximately contain 150 lines, I have plan to process every 3 file input.

Im using Centos,

---------- Post updated at 11:14 PM ---------- Previous update was at 08:56 PM ----------

anybody, please Smilie I must get solution. Smilie
# 4  
Old 05-15-2012
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for string on a range of lines

Hi, I am trying to parse a file searching for specific set of string and then within those set of strings finding a keyword. The script works the way that I intended it to be but I thought it could be a lot simpler may be. Any advice will be much appreciated. The script at the moment is as... (1 Reply)
Discussion started by: newbie_01
1 Replies

2. UNIX for Advanced & Expert Users

Vi remove line range containing a string

In vi I would like to remove a line containing a string. I thought after reading this I could do this. https://www.unix.com/302297288-post3.html :'3560,3572/gcc/d' It keeps complaining vi mark not set. And sometimes it complains E488: Trailing characters. I don't understand what mark... (5 Replies)
Discussion started by: cokedude
5 Replies

3. UNIX for Dummies Questions & Answers

Search specific string logfile specific date range

Hi, I have logfile like this.. === 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header === 2015-02-09... (8 Replies)
Discussion started by: kishk
8 Replies

4. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

5. Shell Programming and Scripting

Replace specific column range in a non-delimited file with a string!

Hi All, I will need an help with respect to replacing a range of columns on a non-delimited file using a particular string pattern. Say file input is MYNUMBERD000000-BAN CHUE INSNTS ** N+ MYAREDSDD000000+BAN CHUE INSNTS ** N+ MYDERFFFSD00000-GIR PENT - ACH ** ... (5 Replies)
Discussion started by: navojit dutta
5 Replies

6. Shell Programming and Scripting

Count occurences of a numeric string falling in a range

Dear all, I have numerous dat files (1.dat, 2.dat...) containing 500 numeric values each. I would like to count them, based on their range and obtain a histogram or a counter. INPUT: 1.dat 1.3 2.16 0.34 ...... 2.dat 1.54 0.94 3.13 ..... ... (3 Replies)
Discussion started by: chen.xiao.po
3 Replies

7. Shell Programming and Scripting

Grep a string in a range and delete the line

Hi, i need to delete a lines after searching a particular string but this searching should only happen after the 4th line.. basically imagine a file like this From: abcd.yahoo.com To: cdeb.yahoo.com Subject: hi all sdfsd sadasd asdasd dfsdf From: abcd.yahoo.com To:... (3 Replies)
Discussion started by: depakjan
3 Replies

8. Shell Programming and Scripting

Finding Minimum value per Row range of data

Here is an example of a file I am working with: C 4704 CB 1318 ASP 115 BGRF 1 weak 0.0% 4.33 C 4720 OD 1322 ASP 115 BGRF 1 weak 0.0% 3.71 O 4723 OD 1322 ASP 115 BGRF 1 weak 0.0% 3.48 O 4723 CG 1321 ASP 115 BGRF 1 weak 0.0% 4.34... (3 Replies)
Discussion started by: userix
3 Replies

9. Shell Programming and Scripting

Replace string in a file within a range of line

Hi, I want to replace the srting '; with ABCD'; in a file from line 1 to line 65. Is there any single command to do it without using awk Thanks for quick reply https://www.unix.com/images/misc/progress.gif (3 Replies)
Discussion started by: tosattam
3 Replies

10. Shell Programming and Scripting

Look a string within a range!

Hi, I've a table with values Low & High. ex: NRA* - NZ99 If the input is NR20, the script should tell me which range it belongs to. I was thinking of splitting the word into alphabets & then comapring each alphabet which is not a modest way. I was wondering if there are any other ways to... (0 Replies)
Discussion started by: azmathshaikh
0 Replies
Login or Register to Ask a Question