Computing.Net > Forums > Programming > read file line by line

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

read file line by line

Reply to Message Icon

Name: genet
Date: February 16, 2007 at 05:25:44 Pacific
OS: xp
CPU/Ram: intel 3.6 ghz
Comment:

hey again!

thx for the help at my last post!
want to ask if there is some way i can read a .txt file line by line ignoring lines beginning with "::" then writing the lines back into a file but without the lines with 2 colons at the beginning. i saw something like this i think using for /f tokens.. thx!



Sponsored Link
Ads by Google

Response Number 1
Name: Fist (by fmwap)
Date: February 16, 2007 at 05:43:08 Pacific
Reply:

I dunno about using "for" to do this, but in *nix it's a simple grep command:

grep -Ev "^::" bah

I would recommend getting GNU grep for win32. It's over here:
http://unxutils.sourceforge.net/


0

Response Number 2
Name: genet
Date: February 16, 2007 at 05:44:28 Pacific
Reply:

o sorry i forgot to say i need this in dos batch..

thx


0

Response Number 3
Name: IVO
Date: February 16, 2007 at 06:08:13 Pacific
Reply:

FindStr /B /V "::" FileName > FileOut


0

Response Number 4
Name: genet
Date: February 16, 2007 at 11:06:54 Pacific
Reply:

thx! works fine.. sorry for the late reply


0

Response Number 5
Name: Mechanix2Go
Date: February 17, 2007 at 00:18:27 Pacific
Reply:

Works in NT. For DOS you'll need a 16 bit regex, like grep.


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

M2



0

Related Posts

See More



Response Number 6
Name: genet
Date: February 17, 2007 at 01:05:51 Pacific
Reply:

hey again thx!

I am still trying to read a file line by line so i can for axemble read the first line echo it, then the second line ect ect ect until EOF: While doing this i want it to exclude lines that begin with ::

sry i ask so much from you all.. but i really do try my best befor asking.

thx again.


0

Response Number 7
Name: Mechanix2Go
Date: February 17, 2007 at 01:12:54 Pacific
Reply:

FindStr /B /V "::" < FileName


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

M2



0
Reply to Message Icon

Creating simple makefile ... Random Help Required



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: read file line by line

read file lines and store in strng www.computing.net/answers/programming/read-file-lines-and-store-in-strng-/18669.html

Parse 2 files line by line to 1 www.computing.net/answers/programming/parse-2-files-line-by-line-to-1/18543.html

C : read/write bit by bit a binary www.computing.net/answers/programming/c-readwrite-bit-by-bit-a-binary/10592.html