Computing.Net > Forums > Disk Operating System > findstr oddities

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

findstr oddities

Reply to Message Icon

Name: Tony
Date: November 26, 2003 at 12:09:53 Pacific
OS: 2000
CPU/Ram: p2
Comment:

Hello.

Ages ago I posted a problem in this thread: http://computing.net/dos/wwwboard/forum/13233.html

The solution that Secret_Doom gave was fantastic, but I've recently discovered a strange prroblem. You see, the numbers I have in the word files are all stored in a table. So each cell contains one number. For some reason, the number in the very first cell (top-left cell of the table) is not being found by the search command. I've had a look at the word file in notepad and it looks like this:

NUMBER497623497147497586497128497501497118

Now, the first number, in this case 497623, is not being found. For reference, the word NUMBER is text written on the word page outside the table.

What's also odd is the above is opening the file under XP. Under 2000, the dots are replaced with small rectangles, like a smaller version of this [], but closed. And there is one between the word NUMBER and the first number, whereas above there is not.

Can anyone figure out how to get the search to find the first number in the table please?



Sponsored Link
Ads by Google

Response Number 1
Name: Tony
Date: November 26, 2003 at 12:14:03 Pacific
Reply:

Something I noticed when posting the above stood out as odd which may indicate the problem.

When I copied and pasted the line from notepad it appeared like this:

NUMBER

497623497147497586497128497501497118

There is a big gap between the word NUMBER and the first number. This doesn't show up in notepad. Only when pasting it into this window. Could that be the problem? I edited the paste in the first post to show what the file looked like in notepad.


0

Response Number 2
Name: IVO
Date: November 26, 2003 at 13:14:53 Pacific
Reply:

I am not sure, but try the following fix to the "magic" Secret_Doom statement

FINDSTR "^[0-9]%1[^0-9] ^%1[^0-9] [^0-9]%1[^0-9] ^%1$ [^0-9]%1$" "c:\path\path\path\*.doc"



0

Response Number 3
Name: SkipCox
Date: November 26, 2003 at 13:20:07 Pacific
Reply:


Tony,

I miss Leonardo too. What if you replace the number in cell 1 with zero's or X's? Would that cause a problem with the table or your batch file?

After reading Leonardo's post, the following comment may be the key here:

"That will only match the string on %1 if it is surrounded by non-numeric characters (or by line breaks)."

Surrounded by looks like it might be the answer. Can you toss a line break in?

Skip


0

Response Number 4
Name: Tony
Date: November 26, 2003 at 14:49:41 Pacific
Reply:

Thanks for the suggestions guys. Looks like my best bet is to void the first cell.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: findstr oddities

FINDSTR command www.computing.net/answers/dos/findstr-command-/13961.html

DOS Help with Find command www.computing.net/answers/dos/dos-help-with-find-command/13555.html

Make current time computer name www.computing.net/answers/dos/make-current-time-computer-name/12469.html