help required in unix command/script


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users help required in unix command/script
# 1  
Old 10-18-2005
help required in unix command/script

Hi All,

Please help me in writting the script
File contains:
=========

11424444, <basicpage>
jfalfksf
<dateofbirth>10/02/2005</dateofbrith>
jkaklgja
lg'd
....
11423224444, <basicpage>
jfalfksf
<dateofbirth>11/02/2005</dateofbrith>
jkaklgja
lg'd
11433523224444, <basicpage>
jfalfksf
<dateofbirth>09/03/2005</dateofbrith>
jkaklgja
lg'd
<dateofbirth>09/03/2005</dateofbrith>

.........
.....


output in 1.txt
======
11424444, <basicpage>
<dateofbirth>10/02/2005</dateofbrith>

output in 2.txt
==========
11433523224444, <basicpage>
<dateofbirth>09/03/2005</dateofbrith>
<dateofbirth>09/03/2005</dateofbrith>



Here if the dateofbrith occurence is once before the next basicpage then the output should go 1.txt file else if the dateofbrith string comes again before the next basicpage string then it should send the output to the other file say 2.txt


Thanks
Satish
# 2  
Old 10-18-2005
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to search a text in file and retrieve required lines following it with UNIX command?

I have requirement to search for a text in the file and retrieve required lines that is user defined with unix command. Eg: Find the text UNIX in the below file and need to return Test 8 & Test 9 Test 1 Test 2 Test 3 Test 4 UNIX Test 5 Test 6 Test 7 Test 8 Test 9 Result can... (8 Replies)
Discussion started by: Arunkumarsak4
8 Replies

2. Shell Programming and Scripting

Command required in shell script.

Hi All I have thousands of files. Each files are having lines with different length. I need to print those filenames whose length of the lines are more than 15. Contents of the files can have space as well as any special characters. eg File1 have below content: Cat File1 123456789... (7 Replies)
Discussion started by: ravi_agarwalla
7 Replies

3. Shell Programming and Scripting

Unix script required

I have a file 123.txt which is aasaasas=1 bsasasasasa=2 sawqas=3 I want my output to be 1 2 3 I am new to scripting can some1 help me out. (14 Replies)
Discussion started by: karthikkasarla
14 Replies

4. Shell Programming and Scripting

Help required on basic Unix Bourne Shell Script

Howdy People :), I'm a newbie & its my first question here. I've started learning Unix Bourne Shell scripting recently and struggling already :p Can someone PLEASE help me with the following problem. Somehow my script is not working. Display an initial prompt of the form: Welcome to... (1 Reply)
Discussion started by: methopoth
1 Replies

5. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

6. UNIX for Advanced & Expert Users

Required unix command!!!

Hi, In a file I have data like... -rw-r----- 1 ftpuser users 1036695 Jul 6 14:59 ./APRIL 2007/Ujjain/My Disc (D)/9565DW07.04B -rw-r----- 1 ftpuser users 124080 Jul 6 14:59 ./APRIL 2007/Vadodara/vad_APRIL07/2082DW07.04B The above data is extracted using "find . -name... (12 Replies)
Discussion started by: ronald_brayan
12 Replies

7. Shell Programming and Scripting

Help Required: To run the attached UNIX script

Hi, This Script contains update statements and running without error. But the update result is not getting reflected in the database. i.e may be Script fails to connect to the database. it would be of great help if you could figure out the problem. Thanks, Shruti Script follows here:... (5 Replies)
Discussion started by: Shrutiduggal
5 Replies

8. UNIX for Dummies Questions & Answers

Unix command help required

Hi All, Can anyone please help me in sort out the command to get the following command say File abc.log contains .... ...... This is the first line This is the second line This is the third line This is the fourth line This is the fifth line This is the first line This is the... (7 Replies)
Discussion started by: thaduka
7 Replies

9. UNIX for Dummies Questions & Answers

Help Required in Unix Command

Hi All, Can anyone please help me in unix command Query: ==== File contains data along with date and time stamp like, .. Date: 08:23:2005 01:00:00 method: xyz init variables Date 08:23:2005 01:00:01 method: xyz finished init variable .... (2 Replies)
Discussion started by: thaduka
2 Replies

10. Solaris

unix command required.

I need to get a few details from the command line. I need to get the kilobytes per second that my server is transfering to another or has available and I need to test the connection to make sure that its a sound connection. I also need to keep track of the response time. I have been playing... (1 Reply)
Discussion started by: nowayin
1 Replies
Login or Register to Ask a Question