Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Use awk to change an IP format Post 302768459 by MrEddy on Friday 8th of February 2013 03:03:42 PM
Old 02-08-2013
Awesomeness thanks! works like a charm
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change the empty function from the old format to the new format

I have about 300 files which has the function getDBBackend(). How to write a program to change the empty function from the old format to the new format? Old empty function format are either: function getDBBackend() { // Not available } // getDBBackend or: function... (0 Replies)
Discussion started by: powah
0 Replies

2. Shell Programming and Scripting

awk,cut fields by change field format

Hi Everyone, # cat 1.txt 1321631,77770132976455,19,20091001011859,20091001011907 1321631,77770132976455,19,20091001011859,20091001011907 1321631,77770132976455,19,20091001011859,20091001011907 # cat 1.txt | awk -F, '{OFS=",";print $1,$3,$4,$5}' 1321631,19,20091001011859,20091001011907... (7 Replies)
Discussion started by: jimmy_y
7 Replies

3. Shell Programming and Scripting

How can I change is output format by awk ?

Hello, Can you tell me how can I change this format by awk Input 0.2057422D-01 0.2463722D-01 -0.1068047D-02 Output 0.02057422 0.02463722 -0.001068047 Thanks wan (8 Replies)
Discussion started by: wanchem
8 Replies

4. Shell Programming and Scripting

using awk or bash to change the format

tenxun-glibc_code-x86-64-linux-20120713190049.root.tar.bz2 To tenxun-glibc_code-x86-64-linux.root.tar.bz2 (3 Replies)
Discussion started by: yanglei_fage
3 Replies

5. Shell Programming and Scripting

Change a file content format using awk

Hi, i have a file input.txt Continent North America Country USA Capital Washington D.C. Country Canada Capital Ottawa Continent South America Country Argentina Capital Buenos Aires Country Brazil Capital Brasília Coutry Colombia Capital Bogotá and i want to get an output.txt ... (3 Replies)
Discussion started by: fastlane3000
3 Replies

6. Shell Programming and Scripting

awk - change date format

I have below date format in a CSV file. (dd/mm/yyyy) Ex Input: 9/8/2013 Need to convert it into below format (yyyymmdd ) and redirect to new file. Ex Output: 20130809 How do I use awk here to change the format and if leading 0 (zero) is not then add it. Please help. Thanks. (8 Replies)
Discussion started by: vegasluxor
8 Replies

7. UNIX for Dummies Questions & Answers

Des/awk for change format and adding integers in a column of data?

Greetings! I need a quick way to change the format in a table of data Here is an example of the input: 10 72 Value=177 VDB=0.0245 Value4=0,0,171,0 10 274 Value=238 VDB=0.0433 Value4=29,0,205,0 10 312 Value=222 VDB=0.0384 Value4=8,0,190,19 10 540 Value=405 VDB=0.0391 Value4=13,30,153,195... (3 Replies)
Discussion started by: Twinklefingers
3 Replies

8. Shell Programming and Scripting

Datestamp format 2nd change in csv file (awk or sed)

I have a csv file formatted like this: 2014-08-21 18:06:26,A,B,12345,123,C,1232,26/08/14 18:07and I'm trying to change it to MM/DD/YYYY HH:MM for both occurances. I have got this: awk -F, 'NR <=1 {print;next}{"date +%d/%m/%Y\" \"%H:%m -d\""$1 "\""| getline dte;$1=dte}1' OFS="," test.csvThis... (6 Replies)
Discussion started by: say170
6 Replies

9. Shell Programming and Scripting

Need to change date format in a csv file using awk

Example: Input csv file 00245DLS,Sitel Ocala,12/31/2014,18:45,1.00,7.00,0.00,0.00 00245DLS,Sitel Ocala,12/31/2014,19:00,-1.00,-1.00,-1.00,-1.00 00245HB,Charlotte,01/01/2015,00:00,-1.00,-1.00,-1.00,0.00 Output csv file 00245DLS,Sitel Ocala,2014/12/31,18:45,1.00,7.00,0.00,0.00 00245DLS,Sitel... (8 Replies)
Discussion started by: adit
8 Replies

10. UNIX for Beginners Questions & Answers

Date format conversion how to change this from using nawk to awk

Hi, I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk. Test run as below: $: cat xyz.txt A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
ASP(1)								    User Manual 							    ASP(1)

NAME
asp - find an host IP address by its name SYNOPSIS
asp [-uv] [-f | [-d dir] [-e ext]] [-a addresses] [-r repetitions] [-s send_delay] [-w wait_time] [-p port] hostname asp -V DESCRIPTION
Asp finds the IP address of an Internet connected host. In order to find it, the peer hostname (not the FQDN), and the range of its possi- ble IP addresses need to be specified. Those IP addresses could be simple IP addresses as 127.0.0.1 or "metaip" addresses as 127.0.0.1-20 or 127.0.0.*: the former is a simple way to avoid to type a lot of consecutive addresses, the latter is short for 127.0.0.1-254. In order to simplify the management of the associations between hostnames and addresses, asp searches in a specified directory a text file containing the possible IP addresses of the looked for host. The name of the text file has to be formed by the hostname followed by an optional extension of your choice. For example to find the author's dynamic IP address, obviously if I am on line, you can provide my metaip address on standard input with the command: echo "195.31.186.1-62 194.166.58.2-18" | asp -f atomic or you can put my metaip address in a file called atomic in your ~/.asp directory, like this: echo "195.31.186.1-62 194.166.58.2-18" > ~/.asp/atomic and then you can simply do: asp atomic OPTIONS
-u Update the file /etc/hosts with the IP address of hostname or delete the possible old entry if the address is not found. Obviously the file have to by writable by the user. -v Include more verbiage to make output readable by humans. Default consists only of dotted quad IP address, which is intended for output substitution in scripts. -f Force the reading of addresses from standard input instead that from the hostname's file. -d dir Set the directory containing the addresses file referred by hostname to dir. Default is ~/.asp. -e ext Set addresses files extension to ext. Default is no extension. -a addresses Set the number of queries to send before make a pause of send_delay seconds. Default is 12 queries. -r repetitions Set the number of times to try the same address. Default is 3 times. -s send_delay Delay the sending of the next group of addresses send_delay seconds. Default is 2 seconds. -w wait_time Wait the peer reply for wait_time seconds. Default is 5 seconds. -p port Specify an alternative port number. For default the port number is obtained searching the asp entry in /etc/services. -V Show version information. ENVIRONMENT
ASPCMD This variable could be used to store your preferred settings. An option set in this environment variable could be overridden or tog- gled from command line. BUGS
UDP is an unreliable protocol, therefore there is a chance you will not find the host even if it is on line. Anyway, if you are sure that the peer is on line and asp aware, you could adjust the various parameters until you get a reply. At last you will find the correct set- tings for your particular needs. This until the RDM communication style will be implemented under Linux. Obviously the hostname has to be unique among the possible IP addresses: asp will hook to the first correct reply. AUTHOR
Stenio Brunetta <stenio@brunettaeperin.it> Comments and suggestions are welcome. ACKNOWLEDGMENTS
Steven N. Hirsch <shirsch@ibm.net> for v1.3 bug fix and for the verbose option. Colin Phipps <cphipps@doomworld.com> for the tmpnam security issue. SEE ALSO
aspd(8). Linux February 1997 ASP(1)
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy