473,241 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

find and replace IDE

IDE 2003 (C#)
need to replace last string by a carriage return line feed
find themethod();
replace it by
themethod();
int i++;

thanks
Jun 27 '08 #1
5 1106
Well, I can't remember much about VS2003, but 2005/2008 support regex
for find... but:
* your "int i++;" doesn't compile...
* why not put the necessary code inside themethod()???
* if you need it outside (why?), then perhaps be pragmatic and just
put it on the same line... i.e. themethod(); i++;

But again: just put the necessary code inside themethod() - or if you
can't change themethod(), change themethod() to SomeOtherMethod()
[which you provide], and have SomeOtherMethod() do the necessary
intermediary step... the JIT will probably inline it anyways!

Marc
Jun 27 '08 #2
Also - remember that .cs is just a text file - you can use your
preferred text editing software to change it; heck, even install
VS2008 ("express" edition is free, and has "refactor" support), use
that to edit the files, and then take the .cs back to VS2003 (I'm
assuming you want to target 1.1).

As a final option; consider switching to VS2005/VS2008 and using MSBee
to target 1.1; I haven't tried it myself, but some people like it ;-p

Marc
Jun 27 '08 #3
The regex is way to go. My "Multiline Search and Replace in Visual
Studio" macro can do it for you:
http://www.helixoft.com/blog/archives/15

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
..NET and ASP .NET code
Jun 27 '08 #4
Hello Marc:

it is just a simple sample,
and yes I have replaced on the same line. (when it can)

The replace is going to happen, adding blocks of code
"Marc Gravell" wrote:
Well, I can't remember much about VS2003, but 2005/2008 support regex
for find... but:
* your "int i++;" doesn't compile...
* why not put the necessary code inside themethod()???
* if you need it outside (why?), then perhaps be pragmatic and just
put it on the same line... i.e. themethod(); i++;

But again: just put the necessary code inside themethod() - or if you
can't change themethod(), change themethod() to SomeOtherMethod()
[which you provide], and have SomeOtherMethod() do the necessary
intermediary step... the JIT will probably inline it anyways!

Marc
Jun 27 '08 #5
thanks Peter, nice macro and all that it will help a lot, specially the
concept.

I will add that it would be nice a standalone exe for it.

Last, back to my question... can you tell me how to replace adding carriage
return line feed? I can use vs2005 IDE it is fine

"Peter Macej" wrote:
The regex is way to go. My "Multiline Search and Replace in Visual
Studio" macro can do it for you:
http://www.helixoft.com/blog/archives/15

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
..NET and ASP .NET code
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: hokieghal99 | last post by:
import os, string print " " setpath = raw_input("Enter the path: ") def find_replace(setpath): for root, dirs, files in os.walk(setpath): fname = files for fname in files: find =...
7
by: Bart Nessux | last post by:
x = str.find(temp, '120.50') I am looking for '120.50' '120.51' '122.78' etc. How can I do this with just one str.find... I can use re if I must, but I'd like to avoid it if possible.
1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
1
by: James Vitale | last post by:
Using vb asp.net 1.1 I'm doing a word automation on a doc file and trying to do a find and replace. My existing code works fine except that it doesn't find and replace in the header. My code...
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
0
by: Rave | last post by:
This is a long shot, but I thought I'd try it. I am currently using excel as an inventory tool. I currently have a hand-held scanner plugged into a laptop for reading barcodes. Using the "Find and...
2
by: john | last post by:
In a table I have text field A. I would like to replace all the null values in field A to a real value, let's say 'Test'. When I use Find & Replace and I search for 'is null' and I press replace or...
3
by: TOXiC | last post by:
Hi everyone, First I say that I serched and tryed everything but I cannot figure out how I can do it. I want to open a a file (not necessary a txt) and find and replace a string. I can do it...
3
by: mouac01 | last post by:
Newbie here. How do I do a find and replace in a binary file? I need to read in a binary file then replace a string "ABC" with another string "XYZ" then write to a new file. Find string is the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.