Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a large database and I am trying to pull certain portions of a field out of it and display that in its own file.
Basically I have a field that contains e-mail received line headers. I want to take that field and pull only the IP address contained in that received line out and display it in another file. I have been told that sed and grep are what I should be looking at rather than awk, the problem is that I have very limited knowledge of Unix. the field that i am trying to extract the IP addresses from is in the 3rd column under the name "value." If anyone can tell me what i should be looking at in Unix books to figure out how to accomplish this or help me out in any way i would really appreciate it.

For starters you're going to have to give more details - like what database you're using.
Once the database is known somebody should be able to help you execute a select:
select value from table_name
Then you have to tell us if the IP address is in value or if we have to parse value for the address.

cut -d " " -f3 $DB_OUTPUT_FILE
-d " " specifies that the delimiter of columns is one space
-f3 means that I want the third columnYou don't have to dump the data from the DB. Are you using Oracle ? Using substr and instr Oracle functions in Oracle SQL, you'll be able to get IP directly from your table.
Luke Chi

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |