How delimiter in text files..urgent!!! please


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How delimiter in text files..urgent!!! please
# 1  
Old 04-30-2006
Question How delimiter in text files..urgent!!! please

hi,
I want the result just date,time,%loss, and average. I stored the results of ping test in text files. How can I grep all of them and keep the result in another file ?
this is example:

Mon 04/03/2006
12:00 AM

Pinging 01.123.213.36 with 32 bytes of data:

Reply from 01.123.213.36: bytes=32 time=30ms TTL=252

Reply from 01.123.213.36: bytes=32 time=26ms TTL=252

Reply from 01.123.213.36: bytes=32 time=21ms TTL=252

Reply from 01.123.213.36: bytes=32 time=16ms TTL=252

Reply from 01.123.213.36: bytes=32 time=38ms TTL=252

Reply from 01.123.213.36: bytes=32 time=37ms TTL=252

Reply from 01.123.213.36: bytes=32 time=18ms TTL=252

Reply from 01.123.213.36: bytes=32 time=29ms TTL=252

Reply from 01.123.213.36: bytes=32 time=24ms TTL=252

Reply from 01.123.213.36: bytes=32 time=18ms TTL=252



Ping statistics for 01.123.213.36:

Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 16ms, Maximum = 38ms, Average = 25ms

thanks! Smilie
# 2  
Old 04-30-2006
Hello,

Try with fping [1] network utility instead of standar UNIX ping command.. here is a little example and her output:

Quote:
$ fping -C 1 -q 192.168.0.2
192.168.0.2 : 0.54
I think that this fping's output is more simple to parse with awk, sed, etc.. and to storage in a variable..

For the date you can use traditional date command:

Quote:
$ date +"%Y-%m-%d %H:%M:%S"
2006-04-30 13:56:49
Regards,

[1] http://www.fping.com/

--
Santi Saez
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to target certain delimiter to split text file?

Hi, all. I have an input file. I would like to generate 3 types of output files. Input: LG10_PM_map_19_LEnd_1000560 LG10_PM_map_6-1_27101856 LG10_PM_map_71_REnd_20597718 LG12_PM_map_5_chr_118419232 LG13_PM_map_121_24341052 LG14_PM_1a_456799 LG1_MM_scf_5a_opt_abc_9029993 ... (5 Replies)
Discussion started by: huiyee1
5 Replies

2. Shell Programming and Scripting

Shell script to put delimiter for a no delimiter variable length text file

Hi, I have a No Delimiter variable length text file with following schema - Column Name Data length Firstname 5 Lastname 5 age 3 phoneno1 10 phoneno2 10 phoneno3 10 sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies

3. UNIX for Dummies Questions & Answers

Remove text in particular delimiter

I have input file like this 551|552|553|554|555|556|557|558|559|560 I need any one offset need to be blank for eg. 551|552|553||555|556|557|558|559|560 My Shell is csh (1 Reply)
Discussion started by: nsuresh316
1 Replies

4. Shell Programming and Scripting

cut with delimiter respect text

Hi, Can someone help me to get the shortest command Input file ========= I|know|"english|french" It|can|have|four|delimiters Desired output =========== "english|french" have If I use cut -d "|" -f3 , i am getting "english as 3rd field.But I would like to get the whole text in... (2 Replies)
Discussion started by: anandapani
2 Replies

5. Programming

perl - problem sending text with delimiter

Hello, i encountered this in perl but it might be command line related as well: i am sending text as an argument to echo command on remote computer. if the text has alphanumeric characters only, say 'hello world' all is well. if however text has metacharachters, e.g. 'hello | world' or even... (2 Replies)
Discussion started by: ole111
2 Replies

6. Shell Programming and Scripting

Extract 2 or more int from the text with delimiter.

Hi All, I want to extract the integers from the each line, each line may have 2 or more integers. The following command is appending each integers. echo "Hi I am 100, my friend is 500, his friend is 423" | sed "s///g" 100500423 I need to have delimiter "|" between the integers. If anyone... (18 Replies)
Discussion started by: sarwan
18 Replies

7. Shell Programming and Scripting

URGENT: Script/Function needed to read text property files in block wise

Hi, Iam in a need for a script/function in KSH where I want to read a text file (property file) in block by block. Here is the example: Heading Name Descripton Block Block1 Value1 Description Property Name Value Property Name Value Property Name Value Property Name Value Property Name... (7 Replies)
Discussion started by: ysreenivas
7 Replies

8. Shell Programming and Scripting

Adding a delimiter to a text file

Im writing a KSH script to read a simple text file and add a delimiter. Ive written the following script but it runs very slow. I initially used the cut command to substring the input record then switched to this version using awk to substring... both run too slow. Any ideas how to make this more... (2 Replies)
Discussion started by: lock
2 Replies

9. UNIX for Dummies Questions & Answers

extract fields from text file using delimiter!!

Hi All, I am new to unix scripting, please help me in solving this assignment.. I have a scenario, as follows: 1. i have a text file(read1.txt) with the following data sairam,123 kamal,122 etc.. 2. I have to write a unix... (6 Replies)
Discussion started by: G.K.K
6 Replies

10. Shell Programming and Scripting

Insert text between delimiter

Can someone help me on this? I'm creating an Insert stmt script but Oracle does not accept blanks values. How can I insert the word null between two commas? I'm guessing awk or sed. Is there a good post or site with easy to understand info on awk and sed? I'm really new to unix scripts :D ... (5 Replies)
Discussion started by: ystee
5 Replies
Login or Register to Ask a Question