Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i need to write a program, to fetch a number, when i enter the number as input, it should display from the number which i gave as input to the preceeding number the file may be like this

B456
---------------
---------------

b567
----------------
----------------

g678
-----------------
-----------------
share|improve this question

closed as off topic by Kez, Mike Fitzpatrick, Bobby, Sathya Mar 31 '11 at 7:20

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Yadayada, 1) wrong site (should belong to StackOverflow), 2) poor question, 3) you won't get full source code here, because people want so see that you have put at least some effort into your question (like formatting it properly). –  slhck Mar 31 '11 at 7:11
    
grep <number> <file> -C 4 | head -n 1 –  Sirex Mar 31 '11 at 8:40
    
That should do it. ^^^ –  Sirex Mar 31 '11 at 8:41
add comment

Browse other questions tagged or ask your own question.