Using Notepad++ to help bulk edit maps

   #1  

Jef

Ross-Tech Employee
Staff member
Joined
Jan 29, 2014
Messages
2,505
Reaction score
4,176
Location
HQ
Oct 17, 2020.... this Notepad++ method is now outdated. We now have a simple way to to bulk prep maps for forum posting:

Click here for Alligator Attack!!!


How I'm using Notepad++ to add [CODE][/CODE] tags in bulk.



Get files into a single folder, highlight them, right click and then Edit with Notepad++ (make sure you had no other active files in Notepad++).



To add the [CODE] tag at the beginning of each file:
In Notepad++ go [Search] then [Replace...].

  • Find what: (.*)
  • Replace with: [CODE]\r\n\1
  • Search Mode = Regular expression AND matches newline enabled.
Once set up, click the [Replace All in All Opened Documents]




To add the [/CODE] tag at the end of each file:
In Notepad++ go [Search] then [Replace...].

  • Find what: (.*)
  • Replace with: \1\n[/CODE]
  • Search Mode = Regular expression AND matches newline enabled.
Once set up, click the [Replace All in All Opened Documents]




With that, all the blockmaps or adpmap files you had opened up will now have the [CODE][/CODE] tags, so you can just copy/paste them into the forum post.
 
Last edited:
   #2  

Jef

Ross-Tech Employee
Staff member
Joined
Jan 29, 2014
Messages
2,505
Reaction score
4,176
Location
HQ
How to add the filename to each map:

After you have the [CODE][/CODE] tags added to maps, you can also add the file names to the maps which can be useful for future search quires.

In Notepad++ go to [Settings] and then [Preferences...] Go to the MISC. at the bottom of the list, and then disable "Document Switcher" by unchecking the "Enabled" box.



Click on [Close].

Make sure you are now on the far left tab. Click on [Macro] and then select [Start Recording]. On the first tab, right click and from the drop down menu select [Filename to Clipboard].



Now go up to the first line of the file and paste in the filename, then line return a couple of times. You should now have the filename as the very first line of text, and then a blank line, then the [CODE] tag like so:



Now do CTRL+TAB on your keyboard and Notepad++ should switch to the next tab to the right. Click on [Macro] and then select [Stop Recording]. Click on [Macro] again and select [Run Macro Multiple Times...]. Have "Run" selected and X number of times for the amount of files you have open, 14 in this example:



Click on [Run] with that, the Macro should perform a right click on the open tab, copy the filename, paste filename (cursor should be in top left by default), line return twice, then jump to the next tab. Wash/rinse/repeat.
 
   #3  

Jef

Ross-Tech Employee
Staff member
Joined
Jan 29, 2014
Messages
2,505
Reaction score
4,176
Location
HQ
Sorting the order and merging them into a super mega copy/paste file...

So you've got the file names and [CODE][/CODE] into the maps, now we need to get the files (tabs) in the correct order. We are wanting the files to be in the same order as you see the control modules in the Gateway Installation List:

01-Engine -- Status: OK 0000
02-Auto Trans -- Status: OK 0000
03-ABS Brakes -- Status: OK 0000
08-Auto HVAC -- Status: OK 0000
09-Cent. Elect. -- Status: OK 0000
15-Airbags -- Status: OK 0000
16-Steering wheel -- Status: OK 0000
17-Instruments -- Status: OK 0000
19-CAN Gateway -- Status: Malfunction 0010
29-Left Light -- Status: OK 0000
32-Differential Locks -- Status: OK 0000
36-Seat Mem. Drvr -- Status: OK 0000
39-Right Light -- Status: OK 0000
3C-Lane Change -- Status: OK 0000
42-Door Elect, Driver -- Status: OK 0000
44-Steering Assist -- Status: OK 0000
46-Central Conv. -- Status: OK 0000
47-Sound System -- Status: OK 0000
52-Door Elect, Pass. -- Status: OK 0000
5F-Information Electr. -- Status: Malfunction 0010
6C-Back-up Cam. -- Status: OK 0000
6D-Trunk Elect. -- Status: OK 0000
74-Chassis Control -- Status: OK 0000
75-Telematics -- Status: OK 0000
81-Gear Shift -- Status: OK 0000
A5-Frt Sens. Drv. Assist -- Status: OK 0000
A9-Struct. Borne Sound -- Status: OK 0000
BB-Door Rear Drv -- Status: OK 0000
BC-Door Rear Pass -- Status: OK 0000
CA-Sunroof -- Status: Malfunction 0010
CF-Lane Chge Asst 2 -- Status: OK 0000
D6-Light Ctrl Left 2 -- Status: OK 0000
D7-Light Ctrl Right 2 -- Status: OK 0000
Notepad++ can get the bulk of the files/tabs in the correct order, but you will need to do some manual tweaking as well. In Notepad++, go to [Window] the select [Windows...]



In the new "Windows" box that opens up, click on the "Name" (shown in blue) to sort the files by name. You are wanting to see the Engine, address 01 (blockmap-01) at the top. Then click on [Sort tabs], followed by [OK].



This should be the bulk of the maps in a correct order that matches the Gateway Installation List. However, it is difficult to tell when you've got 35 tabs open which ones are not in the correct order. We need to open up the "Document List Panel" in Notepad++. Go to [Settings] then [Preferences...]



In the Preferences window, you need [General] and then check the two boxes under "Document List Panel", then [Close].



You should now have a list of files (Doc Switcher) on the left side of Notepad++ and you can see what order they are in.



So to move the files around into the correct order, in the Doc Switcher, click on a file that is out of place, the blockmap-5F in this example:



This will make that tab active. Move your mouse over the active tab, hold the Shift key down and then scroll your mouse wheel up or down to move the file around, you will see it's position change in the Doc Switcher list. You have to keep the mouse cursor over the tab list when doing the Shift+scroll wheel. Repeat the steps as need so you have the files shown in the correct order. Notice I've also moved the Auto-Scan to the top of the list.



Now that the files are in the correct order, we are ready to merge them together. You need to install a plugin to Notepad++. Click on [Plugins] and then [Plugins Admin...]



Scroll down and select Combine (version 1.0 at this time). Then click [Install].



Notepad++ will do its thing and then shutdown and restart. Now click on [Plugins], then [Combine] and then [Start].



This opens up a "NPP Combine 1.0" window, don't check any boxes, just click [OK].



Some magic will happen and when it is done, you will have a "new" text file. Copy that and paste it into your post over at the Reference Scans and Maps of Non-Broken Cars section. Here is what the results look like:

https://forums.ross-tech.com/showthread.php?18695-2019-SQ5-3-0-CWGD&p=206227&viewfull=1#post206227
 
Top