Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep command? 1

Status
Not open for further replies.

inteleserve

IS-IT--Management
Dec 13, 2002
75
0
0
US
Is there a way I can search *.dbf files in a certain directory for a phone number?

lets say i was looking for the phone number 2323435566 and I wanted to find out all .dbf or.ind files that contain this number?

Thanks,

Ross
 
This is not working, just moves on to the next line...any other ideas?

Thanks,
 
Okay. Is the number in this format? Are the files readable, meaning are they in some sort of text format and not in a compiled format. Are you sure the number exists in these files? And are you in the directory where the .dbf and .ind files exist?

Just need to ask since that should work without any issues.
 
yes, i am in the directory of the files. I can open them up with foxpro and they area readable. They are in db4 format type foxplus. If I brought one of these over to my windows machine it would open with excel. Hope this helps....

Thanks for your time....
 
I am not to familiar with FoxPro, I would assume that you have to export the database table to a .csv file for excel to open it like any other database table, correct?

To get this to work correctly, export the tables first and then run the grep command. Otherwise you could use an SQL query to get the information you need, but I am not that big of an SQL buff to know what syntax you would require.

Going on the export table route, this can be done from a shell script as well. You just need to know how to access the database via the command line and then run the export commands from there to <TABLENAME>.txt or .dat file.
 
u can try string <TABLENAME.dbf> | grep '2323435566'



[ponder]
----------------
ur feedback is a very welcome desire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top