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

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jim
Posts: 2
Joined: Tue Jun 22, 2004 8:36 pm

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

Post 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
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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.
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post 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:
Then I open up and see
the person fumbling here is me
a different way to be
jim
Posts: 2
Joined: Tue Jun 22, 2004 8:36 pm

Post 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
User avatar
skaemper
Posts: 51
Joined: Mon Mar 03, 2003 1:07 pm
Location: (Northern) Germany
Contact:

Finding stuff in binary files

Post 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
"It's POLYMORPHIC!"
A former colleague
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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).
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
Post Reply