Deleting data


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Deleting data
# 1  
Old 01-09-2014
Code Deleting data

Need Assistance in a script to delete date for Below example

There are four period(.) line . I wanted to delete 2 period(.) from below .



Code:
5  .TODAY...MOSTLY SUNNY. HIGHS 58 TO 63. LIGHT WINDS IN THE MORNING
6  BECOMING NORTH 10 TO 15 MPH IN THE AFTERNOON.
7  .TONIGHT...MOSTLY CLEAR. LOWS 29 TO 37. WEST WINDS UP TO 10 MPH.
8  .FRIDAY...SUNNY. HIGHS 58 TO 63. LIGHT WINDS.
9  .FRIDAY NIGHT...MOSTLY CLEAR. HAZE. LOWS 29 TO 39. LIGHT WINDS.

# 2  
Old 01-09-2014
Quote:
Originally Posted by ajayram_arya
Need Assistance in a script to delete date for Below example

There are four period(.) line . I wanted to delete 2 period(.) from below .



Code:
5  .TODAY...MOSTLY SUNNY. HIGHS 58 TO 63. LIGHT WINDS IN THE MORNING
6  BECOMING NORTH 10 TO 15 MPH IN THE AFTERNOON.
7  .TONIGHT...MOSTLY CLEAR. LOWS 29 TO 37. WEST WINDS UP TO 10 MPH.
8  .FRIDAY...SUNNY. HIGHS 58 TO 63. LIGHT WINDS.
9  .FRIDAY NIGHT...MOSTLY CLEAR. HAZE. LOWS 29 TO 39. LIGHT WINDS.

It's not clear what your desired output would look like....
# 3  
Old 01-09-2014
Code:
5  .TODAY...MOSTLY SUNNY. HIGHS 58 TO 63. LIGHT WINDS IN THE MORNING
6  BECOMING NORTH 10 TO 15 MPH IN THE AFTERNOON.
7  .TONIGHT...MOSTLY CLEAR. LOWS 29 TO 37. WEST WINDS UP TO 10 MPH.
8  .FRIDAY...SUNNY. HIGHS 58 TO 63. LIGHT WINDS.
9  .FRIDAY NIGHT...MOSTLY CLEAR. HAZE. LOWS 29 TO 39. LIGHT WINDS.


output
Code:
5  .TODAY...MOSTLY SUNNY. HIGHS 58 TO 63. LIGHT WINDS IN THE MORNING
6  BECOMING NORTH 10 TO 15 MPH IN THE AFTERNOON.
7  .TONIGHT...MOSTLY CLEAR. LOWS 29 TO 37. WEST WINDS UP TO 10 MPH.

# 4  
Old 01-09-2014
Quote:
Originally Posted by ajayram_arya
Code:
5  .TODAY...MOSTLY SUNNY. HIGHS 58 TO 63. LIGHT WINDS IN THE MORNING
6  BECOMING NORTH 10 TO 15 MPH IN THE AFTERNOON.
7  .TONIGHT...MOSTLY CLEAR. LOWS 29 TO 37. WEST WINDS UP TO 10 MPH.
8  .FRIDAY...SUNNY. HIGHS 58 TO 63. LIGHT WINDS.
9  .FRIDAY NIGHT...MOSTLY CLEAR. HAZE. LOWS 29 TO 39. LIGHT WINDS.

output
Code:
5  .TODAY...MOSTLY SUNNY. HIGHS 58 TO 63. LIGHT WINDS IN THE MORNING
6  BECOMING NORTH 10 TO 15 MPH IN THE AFTERNOON.
7  .TONIGHT...MOSTLY CLEAR. LOWS 29 TO 37. WEST WINDS UP TO 10 MPH.

Hmmmmm,,,, I'm having trouble relating the 'description' to the provided sample.
Description:
Code:
Need Assistance in a script to delete date for Below example

There are four period(.) line . I wanted to delete 2 period(.) from below .

Could you try describing once again how you get from 'input' to 'output' again, please!
# 5  
Old 01-09-2014
Something like this?
Code:
awk '/\.\.\./ && ++c>2 {next} 1' file

This User Gave Thanks to Franklin52 For This Post:
# 6  
Old 01-09-2014
Franklin52 this is perfectly what i wanted .....Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting a pattern in UNIX without deleting the entire line

Hi I have a file: r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e) I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies

2. UNIX for Dummies Questions & Answers

Deleting the unwanted data based on condition

hi i have my input data like this aaa bbb ccc asa dff nmj mnj saa dff oik aax cdx saa oik asq sdf dssi want my output file to be like this mnj saa dff oik aax cdx saa oiki want to retain only those lines which will have oik just below them and i want oik to be as next column to those... (1 Reply)
Discussion started by: anurupa777
1 Replies

3. Shell Programming and Scripting

Help with database deleting data!!!

Hi, I'm new to programming in shell and I wanted to make a simple database on shell script but I'm having trouble in deleting data. I would apreciate any kind of help. Thank you in adavanced. (7 Replies)
Discussion started by: Lina_14
7 Replies

4. Shell Programming and Scripting

Script problem with deleting data

The 10.Delete data doesnt work at all, plesase anyone could help on that. When I choose options 10 to delete a record it only copy the selected data on the other file dbs1 but doesnt delete it from the database where other records are. #! /bin/bash i="y" echo "Enter name of database " read db... (6 Replies)
Discussion started by: Lina_14
6 Replies

5. Shell Programming and Scripting

Insert row without deleting previous data using sed

Hello, I want to add a new row to a file to insert data without deleting the previous data there. Example: file a b c d Output a b newtext c (6 Replies)
Discussion started by: joseamck
6 Replies

6. Shell Programming and Scripting

Deleting shorter lines from data file

Hello, I have the following data file structure: 1234 text 2345 text 3456 text text text 4567 text text text 5678 text text text 6789 text text text I simply want to delete all of the lines that only have one text column (i.e. the first two lines in this case). The output would be:... (1 Reply)
Discussion started by: palex
1 Replies

7. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

8. AIX

Permanentky deleting data from disk drives for a decommissioned server.

I am about to retire several servers and need to delete the company confidential data from the internal disks under LVM control. Is there a proven and easy way to accomplish this ? Thanks for all the help in advance. (4 Replies)
Discussion started by: thenomad
4 Replies

9. UNIX for Dummies Questions & Answers

Howto capture data from rs232port andpull data into oracle database-9i automatically

Hi, i willbe very much grateful to u if u help me out.. if i simply connect pbx machine to printer by serial port RS232 then we find this view: But i want to capture this data into database automatically when the pbx is running.The table in database will contain similar to this view inthe... (1 Reply)
Discussion started by: boss
1 Replies
Login or Register to Ask a Question