Re: Regular Expressions Insert
From: Nick Malik (nickmalik_at_hotmail.nospam.com)
Date: 09/01/04
- Next message: Nick Malik: "Re: Checking Exchange server for new mail"
- Previous message: Rakesh Rajan: "RE: InitializeComponent() question"
- In reply to: J: "Regular Expressions Insert"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 01 Sep 2004 06:02:04 GMT
Oh, for goodness sakes...
In psuedocode
open the input file
open the output file
Read a row
While not EOF
{
OutputFile.WriteLine("{0}/"{1}", InputRow.Substring(1,15),
InputRow.Substring(16));
read next row
}
close all files
Why use a regex for a simple positional thing like this?
--- N
"J" <J@discussions.microsoft.com> wrote in message
news:3C7DBB14-56F8-4458-BFAE-24237B8AC442@microsoft.com...
> Hi group , I'm trying to do an insert of text into every line of a text
> file, e.g., insert double quotes ("") into position 15 through the entire
> file. Here is the expression:
> ([^\r\n]{15}[^\r\n]*\r\n). I want to insert text after the 15th character
> pos, but I when I do a replace it only replaces after the entire
expression.
> Do I need to do grouping with parens to control the replace? I'm
> learning..Thanks for any thoughts..
- Next message: Nick Malik: "Re: Checking Exchange server for new mail"
- Previous message: Rakesh Rajan: "RE: InitializeComponent() question"
- In reply to: J: "Regular Expressions Insert"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|