Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File I/O and text manipulation
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01057415
Message ID:
01057484
Views:
8
>In the old days we did something like this:
>
>
>
>FILE = fopen()
>while ( !FEOF(FILE) )
>{
>   ** Do something here reading or writing
>}
>
>
>
>This is the basic simple file manipulation we used in ANSI C and VFP.
>
>As far as I can tell C# has broken this down into stream readers, stream writers, file streams, file info objects, asynchronous readers and writers, blah blah blah. I don't want a reader and a separate writer. I want a reader/writer on the same existing file that I can read from and insert to.
>
>All I want to do is open a text file, search for certain strings, and insert text at those locations. Why is this such a pain? As near as I can tell I am going to need to open an existing file, read it into a new file with my changes, delete the old file, and rename the new one?
>
>Or perhaps spend another day reading and writing to a FileStream at the byte level?
>
>There must be an easier way to scan and edit a text file.

What about the regular expression object? In the series of articles the late Ed Rauh and I did for VFUG (www.vfug.org) on the Windows Script Host, the last article covered the regular expression object and we demonstrated how to do exactly what you're asking.

I don't know if the .NET parser can do the same things, but it's worth a shot.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform