Computing.Net > Forums > Programming > batch editing txt file

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.

batch editing txt file

Reply to Message Icon

Name: datec
Date: July 12, 2008 at 14:16:15 Pacific
OS: 2k/xp
CPU/Ram: 512
Product: different
Comment:

hey tech guys,
i am working on an batch file, that needs to get the following done:
1. download an txt file from an ftp (easy, already done)
2. open this txt file, look through and delete all rows, next to those, which begin with 7 (changing) digits.

anybody an idea?

thanks a lot for your efforts
datec



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: July 12, 2008 at 16:50:14 Pacific
Reply:

"delete all rows, next to those, which begin with 7 (changing) digits" -- do you mean the rows above those that begin with 7 digits? Or the rows below them? What about the rows that begin with 7 digits themselves?


0

Response Number 2
Name: datec
Date: July 12, 2008 at 21:30:10 Pacific
Reply:

I am sorry...
I mean an text file like this:

abcdef 875 defghi +abc
defghijk defghi 4567890 abc
4673890 important row
12345 cdefghi ijkl
ijklmno 1234567 more
2345789 also important row
rstuvwx cdefghikj

from an text file like this I just want to get the important rows. the rows, that begin with 7 digits.

thank you a lot, I know it's difficult!


0

Response Number 3
Name: Razor2.3
Date: July 13, 2008 at 01:19:57 Pacific
Reply:

findstr "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]" some.txt

Actually, does Win2K have findstr? I forget.


0

Response Number 4
Name: Mechanix2Go
Date: July 13, 2008 at 04:57:33 Pacific
Reply:

Hi Razor2.3,

yep, findstr comes with 2k.


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

M2


0

Response Number 5
Name: datec
Date: July 13, 2008 at 19:39:37 Pacific
Reply:

hey guys,
you're awesome!!! that's great.
i'm just asking myself, how to get not just the numbers but also the rest of the row also "echo"ed >> to another txt-file.
is there anyway to say like if you findstr "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]", than mark whole row and "echo" it out to another file.

Thanks a lot for your efforts...

datec


0

Related Posts

See More



Response Number 6
Name: Razor2.3
Date: July 13, 2008 at 22:53:26 Pacific
Reply:

findstr "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]" some.txt >> another.txt


0

Response Number 7
Name: datec
Date: July 14, 2008 at 01:19:47 Pacific
Reply:

yeah, just fixed it an hour ago by myself.
thanks again for your help!

datec


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch editing txt file

With Batch create .txt file www.computing.net/answers/programming/with-batch-create-txt-file/9975.html

batch to edit a txt file www.computing.net/answers/programming/batch-to-edit-a-txt-file/15327.html

Editing a txt file with batch files www.computing.net/answers/programming/editing-a-txt-file-with-batch-files/19270.html