Delete words in a text document.

April 4, 2009 at 22:05:28
Specs: Windows XP
I have a text file, it is pretty big (1000 lines approx) and it is formatted like this

words more words even more words 1312331

Every line has a scentence then random numbers at the end. I was wondering if there was a ways, since all the numbers start with 1 and are 7 characters if the was a way to do a variable in replacement. Like replace 1****** with nothing. Any help would be appreciated.

Edit: I cannot delete all numbers because there are numbers in some spots, but none begin with 1 or are 7 characters long.


See More: Delete words in a text document.

Report •


#1
April 5, 2009 at 00:59:57
For starters, are you really hoping to do this in DOS?

Does the alledged a scentence [sic] end with a period?

It may help to post a few lines.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
April 5, 2009 at 07:21:37
No, it does not have a period. Some do but not all.

All the lines are formatted the same
its like this: *'s are numbers

******* a scentence is here 1******

I will use any way possible to do this. I just need a simple way to delete any word starting with the number 1 that has 6 other numbers.

Edit:
I have an idea, but i need to know how to just delete a single word, in a batch file. I could do something like this:

set number=999999
:start
set /a number=%number%+1
if %number%=="2000000" goto EOF
command to delete word %number%
goto start
:EOF

This would take a while but at least it would be automated. I just need to know the command to delete a single word, if there is one.


Report •

#3
April 5, 2009 at 18:38:55
I have found a temporary solution, but if there is a better one i would appreciate it.

Report •

Related Solutions

#4
April 11, 2009 at 08:14:39
Any one have a solution, currently i use change.com, i heard there was a v9.11 that let it use files larger than 32kb. Could you post that?

Report •


Ask Question