formating text thru awk
hi!
i have a text file that look like this inside: 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 i want to extract the file using awk that the output look like this 192.168.0.1 invididually(by row) |
I don't understand: what are you trying to achieve?
By which criteria do you want to extract the individual IP addresses, and what do you intend to do with the output? All addresses just separated by an extra new- line? Or what? :} Cheers, Tink |
ok... iam building a script and i want all my server ip address in one file and i want to extract it in row one by one.
i try ...... awk '{ print $1 ;}' myfileipaddress the result...... 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.3 etc... i want the result to this 192.168.0.1 only or 192.168.0.3 iwant it by row not by column :) |
Code:
sed -e "s/ /\\n/g" myfileipaddress |
awk 'BEGIN{RS=" "}{print}' file
Cheers, Tink |
All times are GMT -5. The time now is 07:35 AM. |