Page 1 of 1

Find in Files - doesn't find numbers in Excel files

Posted: Tue Jun 22, 2004 8:47 pm
by jim
I have been using the 'Find In Files' facility in Textpad (ver 4.5.0 and the latest version too).

If I use it to search for a number in a column in an Excel spreadsheet, it will invariably not find that number, even though that number is present in the spreadsheet.

Has anyone come across this before?

e.g. if I search a specific excel file from Textpad's Find in File, and I know that spreadsheet contains the number '2002' I am told that TP 'Cannot find literal string '2002'.

The reason I was using this facility is that part of my job is to keep a track of held up orders. When I find held up orders I send them to another dept. and save the holds in Excel, in a set folder.

If I am unsure if an order has been sent previously as a hold, I want to search the folder containing the spreadsheets, to see if I have sent that order previously.

The Find in Files will find text matches without a problem. I have tried the 'Match Whole Words' and 'Match Case' options as well but it didn't make any difference.

Any ideas?

Thanks

Jim

Posted: Tue Jun 22, 2004 8:57 pm
by MudGuard
Textpad is - as the name hints at - a text editor.

Excel files are NOT text files, they are binary files - numerical data is NOT stored as text in .xls files.

Posted: Tue Jun 22, 2004 9:03 pm
by s_reynisson
Just to confirm your findings. I just tested this, with and without ticking binary files, and I get the same results. Using TP473 and MS Excel 2002 SP2 on WinXP SP2.
Edit, reading Mudguard's post I looked in the TP Help file and found:
How to Find in Multiple Files
You can search for strings in either text (excluding Unicode) or binary files, as follows:

Posted: Wed Jun 23, 2004 5:52 am
by jim
So if the help says that it can search Binary files - is there a problem?

Also, I set the data type of the number column to text in Excel, and TP could still not find the numbers - strange eh?

Thank you for your help

Jim

Finding stuff in binary files

Posted: Wed Jun 23, 2004 8:47 am
by skaemper
Hi,

whatever the file (type) you can certainly search for anything, 2002 for example or The year after they got contact.
Now in many binary files strings are stored, well, as strings. For example you should be able to find the string "This program cannot be run in DOS mode" in almost every Win executable.
But searing for numbers may well be different, as numbers are coded one way or another. Integer values might well be stored as 32-bit binary values (thus the name 'binary' file? I wonder :wink:).
Real number should usually be stored as IEEE standard 754.
In those cases you're out of luck, if you search for 2002 'coded' in the same way as strings are. You won't find them just because it's not there.

Hope that helped,

Stephan

Posted: Wed Jun 23, 2004 9:22 am
by ben_josephs
jim wrote:I set the data type of the number column to text in Excel, and TP could still not find the numbers - strange eh?
How did you set the data type? Did you use Format | Cells | Number ? That just sets the format. If you want the number 2002 stored as a string, enter it as a string: '2002 (i.e., with a leading single quote).

Posted: Wed Jun 23, 2004 9:31 am
by ben_josephs
Better (since you are using a tool designed to handle text): save the spreadsheets as text (e.g., in CSV format) and search that.