12/21/2023 0 Comments Ultraedit regex![]() ![]() I'm OK with using the START button in the REPALCE IN FILES function (as opposed to REPLACE ALL) and verify each replace in each file I just don't want to have to manually add the text with as many files as I need to edit. My end goal is to add to several hundred txt files this string of text consisting of Name/Value pairs and not do it manually 1 file at a time. The file path can be fixed because I will be searching in only 1 directory, but I am searching thru hundreds of files and so the FileName will need to be dynamic. Within this string of text I have added several Name/Value pairs in which some of the values are fixed like the date and some are dynamic like the file name. In this example the string of text is a comment as delimited by the "/*" and "*/ " which are used in the T-SQL language to indicate commented text. SELECT /*XXXXX FilePath=\\MyFileShare\MyFiles\ FileName=rs_This_Is_My_Report.txt Date=1 Area=Main */ The number of spaces on in line 3 below are 9. NOTE: In the CODE sections below the TABLE_A & TABLE_B text are supposed to be aligned but for some reason they don't appear that way in the below CODE boxes and I did use spaces only and no tabs so don't let that throw you. Within this file there is the following 3 lines of text and these 3 lines are not the first 3 lines in the file. ![]() The directory I will be searching in and the name of a file I would want to edit within that directory are listed below:įILE LOCATION/PATH: \\MyFileShare\MyFiles\ In order to keep this as non-verbose as possible I decided the best and easiest way to articulate what I am trying to do is to give a specific example. TextToFind ) and is followed by 1 word and then 1 or more spaces and then on line 2 begins with 0 to many spaces followed by a key word and then replace the text on line 2 with itself plus the file name & path, the current date and a fixed piece of text. GOAL: To locate within a specified folder/share and within files that have a file name pattern, 2 lines of text that in which line 1 begins with 2 '/' characters (i.e. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |