You always seems to be commenting guy rather than proving ideas.
You aren't a teacher and I am not school Kid.
Veera.
Veera- It's very harsh of you, I should say. We are not supposed to teach here as you have mentioned we are not school kid or teacher here. So if you will not tell us how and what you have tried so far how we will help you. This forum is all about learning, we will help each other to learn and before asking for help we will try our best then only at last point we will ask help/guidance to others. Don Cragun is one of the most experience person/admin here(You can see his/admin members profile and come to know about them), so likewise we have a nice, well knowledge, gentle and always helpful team here which will help us always to learn technology. So in spite of blaming people (Which is not supposed to happen by any one at this platform) you can really try hard to learn and share with us what are the difficulties you are facing and we will try our best to help you.
Hope this will help.
Thanks,
R. Singh
Last edited by RavinderSingh13; 09-22-2014 at 09:49 AM..
You always seems to be commenting guy rather than proving ideas.
You aren't a teacher and I am not school Kid.
Veera.
I asked what OS and shell you're using. You have now given us the OS. Are you restricting yourself to only using /bin/sh on Solaris 10? (Your code can be much shorter and more efficient if you're willing to use /bin/ksh, /usr/xpg4/bin/sh, or /usr/xpg6/bin/sh, or /bin/bash instead of /bin/sh.)
I am glad that this is not homework. There are special rules and a special forum where homework assignments are to be submitted. Homework assignments frequently include a small list of utilities that can be used to complete the assignment. So saying that you can't use awk and sed made this look like a homework assignment. Why don't you want to use awk or sed? You have said you want a short script that will give you exact results. You have shown us about 15 lines of code (using sed which you said we can't use) and you haven't solved the problem yet. (And you made a leap of logic that I can't follow between the file you named headerfile in post #1 and the file you named header in post #6 in this thread???
Why wasn't the line:
a header in post #1? Where did the SCHEMA.TABLEdigit come from in post #6 and why do you want to the last two segments to the same file (SCHEMA.TABLE3) which will throw away the contents of the 3rd segment?
You are right. I am not a teacher. My father was a teacher. I got my degrees in computer science and computer engineering more than four decades ago, and I am still a student learning new things about my chosen field every day. If you aren't here to learn; you're in the wrong place. If you're here expecting us to serve as your unpaid programming staff; you're in the wrong place.
If you were willing to use awk and I guessed correctly while making a lot a wild assumptions based on your incomplete design requirements, I would suggest you try something like:
which is a total of 5 lines of code and gives exact results. The awk script could be turned into a single line, but I will choose readable code (rather than the minimum number of lines of code) every time. With the data you showed us in file1 in your 1st post, this script produce the four files: SCHEMA.TABLE1: SCHEMA.TABLE2: SCHEMA.TABLE3:
and SCHEMA.TABLE4:
These 2 Users Gave Thanks to Don Cragun For This Post:
Hello
I have a file with nearly 90000 lines in x,y,z format but have some lines that I do not need to show. Is there anyway to delete those 3 lines after every 288 lines.
Eg I keep the first 288 lines delete (289, 290 291); keep the next 288 lines after those and so on...
Thanks (6 Replies)
Hell,
I want to grep certain word from file and display above 2 lines and after two lines.
Here is the content of sample file.
Mar 14, 2013 12:56:59 AM Agent.Agent SendTo
INFO: Connection to server:7041 - Credential Transmit Successesful
Mar 14, 2013 8:54:21 AM cgent SendTo
WARNING:... (7 Replies)
Hi everybody,
I'd like to think I've been through the search tool not only on this site, but also on google too, but I haven't been able to find what I was looking for. If I might've missed something on this forum, please slap me in the face with a link that you consider useful for my query :D
... (4 Replies)
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
I'm having trouble with extracting certain lines from a file based on whether they have all the required fields.
Original file:
snt:594:Sam N This
bpt:2342:Bob P That
lr:123
wrp:23:Whoever Person
cor:794
Desired output:
snt:594:Sam N This
bpt:2342:Bob P That
wrp:23:Whoever Person
... (3 Replies)
Hi there, if i had a file that looked like this
my_server1
red
green
blue
yellow
blue
my_server2
blue
blue
yellow
green
blue
my_server3
yellow (9 Replies)
Hi
I have a text file which has two sets of lines repeating for "n" number of times.Some data is printed between the two lines.I want to retrieve all the data thats there in between those two set of lines.I have the string value of those two set of lines.
To be much more clearer
... (4 Replies)