I never said that your request was school work; I asked if it was school work because the constraints you placed on solutions are highly unusual. (And, even though you later decided that you could use sed, your first post said we were not allowed to use awk or sed.) If I had decided that this was homework, I would have issued an infraction and closed the thread (as I did for two other threads yesterday)!
The following should run several orders of magnitude faster than the fragments you showed us before. Not only does it avoid both awk and sed, it does not use anything but ksh built-ins. For small files, this will probably even run faster than using awk:
With the original input you provided in your 1st post, it produces three output files: SCHEMA.TABLE1: SCHEMA.TABLE2:
and SCHEMA.TABLE3:
Since you still haven't shown us any sample output, and the data you have shown us in various posts obviously does not come from a single sample input, I have no confidence that this is close to what you want; but it is the best I can do with the data you have provided.
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)
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)
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,
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)
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)
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)
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)