I have a problem with macro in notepad++
Just needs to have value automatically changed to +1 (from current value)
So the values should be like this 1000, 1001, 1002, 1003 and so on for the coming values between the MEDIA_ID tags..
<MEDIA>
<MEDIA_ID>1000</MEDIA_ID>
</MEDIA>
<MEDIA>
<MEDIA_ID>1001</MEDIA_ID>
</MEDIA>
I have no idea how do this..
Could anyone help?
Thanks
1) Generate the list of numbers from 1000 to the number you want using excel and copy this into notepad++.
2) Go to the start of the file.
3) Start the macro recorder.
4) type <MEDIA>(down arrow)(HOME button)<MEDIA_ID>(END button)</MEDIA>(down arrow)(HOME button)</MEDIA>(down arrow)(HOME button)
5) repeat this macro as many times as needed.
If you can align the tags vertically then you might be able to use the Column Editor to do the numbering. Say you format the XML like this:
<MEDIA><MEDIA_ID></MEDIA_ID></MEDIA>
<MEDIA><MEDIA_ID></MEDIA_ID></MEDIA>
....
<MEDIA><MEDIA_ID></MEDIA_ID></MEDIA>
Now, place your cursor betweeen the start and end tags of MEDIA_ID. Choose Column Editor... from the Edit menu (ALT+C keyboard shortcut). Change the radio button to Number to Insert with a starting value of 1001 incrementing by 1 (Decimal). Confirm using the OK button. You should end up with this:
<MEDIA><MEDIA_ID>1001</MEDIA_ID></MEDIA>
<MEDIA><MEDIA_ID>1002</MEDIA_ID></MEDIA>
....
<MEDIA><MEDIA_ID>1199</MEDIA_ID></MEDIA>
Sadly, it seems that this operations cannot be used in a macro. But maybe it helps.
Related
I have a document with over 1000 images (set a), each of which are sitting on separate folder and I am loading them into my word document by entering the path in a "field". The images get uploaded to the word document and displayed.
I have another 1000 images (set b), all of which are named in the exact same way, except that they all end a different letter (b instead of a). I have tried to take my pre-existing and working word document that displayed the first 1000 images (set a), and edit the path in the field so that they all reference the set b images. This change is easy to make as I just need to find and replace everywhere that the text image_a.pngappears with image_b.png.
However, when I do this, the images don't actually refresh and are instead still displaying all of the images from set a. I have played around with a lot of stuff like saving the document as and opening it again, and for a separate issue I had to enter and exit print preview for my number sequence to update, and I tried that for this issue, but that still doesn't help. The only thing that I have found that works is if I go to each field individually, right click on it and select "edit field" and then select ok, and then the correct image will be displayed. However this is not a practical solution because I would have to do this over 1000 times. Does anyone know what is going on here and does anyone know a way to refresh/update all of the 1000 images at once?
Thanks!
Try Ctrl+A followed by the F9 key. You may need to press an Fn key with the F9.
If you need something more nuanced, I can provide a macro. For that, I would need the name of the field being used.
You may want to look at Paul Edstein's tutorial on relative paths in fields.
When doing multi cursor selection, often you need to type a different value for each, you've to cancel selection even though all cursors are where you want them to be.
Is it possible to activate some sort of mode and press tab to automatically iterate through each one by one on every tab and type your value. Esc to cancel the mode.
Note: how in end I had to type 1, 2, 3, 4 manually. Those could have been food categories, clothing size, select options etc.
For the special case of when you want to insert values that follow a sequence at your multiple cursor locations, then the powerful Insert Nums package for Sublime Text can help.
Insert Nums can fill in numbered blanks (1,2,3,4, ... 10), and much more. Just about anything you could write as a for loop can be generated and inserted at the multiple cursors. This includes integer/float/string, count up/down, arbitrary start/stop/step values, and formatting to hex, binary, etc., representation. You can also evaluate an expression at each index, so for example you can create a geometric or power series or a pattern of bit shifts.
The default case for Insert Nums is integers, starting at 1, incrementing by 1, and ending when all selections are filled. For the example problem in the question of numbering Items, all you'd have to do is Ctrl+Alt+N, then Return. The numbers 1 through 5 would be filled in.
In case you don't want to install extension, you can copy sample data (which is generated by your favorite scripts or tools, for example) then paste it to the current cursors.
For example, I generate numbers by a cent JavaScript:
Array(10).fill(0).map((a, i) => i + 1).join('\n')
Then,
I can only answer for Sublime, and there core Sublime can't do this out of the box, but you can add the capability to do it to via a third party package.
The PowerCursors package is one way to go with this. With it installed it's as simple as Alt+[ and Alt+] to cycle between existing cursors (the binds use Ctrl instead if you're on MacOS) and type what you like, amongst other capabilities.
There may well be other packages that incorporate something similar as well, so it may be worth casting around a little bit on packagecontrol.io to see what you can dig up.
For CudaText editor, plugin "Carets Numbering" exists, which does this job. You enter starting number, etc, and it inserts increasing numbers at multi-carets positions.
Text Pastry is a vscode extension which does exactly these type of things.
I have been given a Word file (.docx) that has about 35 figures and tables. When I try to add a cross-reference I get an empty list like this:
I made sure that:
1) The figures and tables are actually captions. If I delete anyone of them, the rest get updated as expected.
2) Other cross-references already in the file works. They get updated correctly like in (1)
3) The document doesn't have any 'track changes'. This is apparently a problem for some people, so I did an 'accept all changes'. Doesn't seem to help unfortunately.
4) I tried copy all and paste into a new file.
5) I tried selecting all and F9.
I'm perplexed why this is happening. Anyone can help me find the root cause?
I know that it is probably late, but maybe it will help somebody else.
Select caption below table/picture
Right click and select Toggle field codes - the caption show the code in format like SEQ xxx xxx
Go to Insert -> Reference -> Caption and click on New Label button
Insert the text following after SEQ from point 2. E.g. Fig.
Save the new label.
Go to Insert -> Reference -> Cross Reference - select the inserted value from point 4 in the Reference type dropdown list. Now you should see all the values.
The answer is based on the following link.
In Word 2013, instead of Insert>Reference>Caption, right click on a figure or table and select insert caption. A dialogue box including the option New Label will appear.
In my case, I think this issue arose because of changes in language. The tables are all captioned with the French Tableau, but in insert references, it had Table and a blank list.
Do you know any easy way to find out what is the length of the current selection in Eclipse?
i.e. I select a line fragment and would like to know how many characters are there?
Usually, I count them manually, but that's stupid. When being desperate, I move to the start, check the column number, move to the end, check the column number, subtract, think a minute if I should add 1 or not... and my selection is lost.
On Windows, Notepad++ is a good solution. Open a new tab, copy and paste in there and the length of the document listed at the bottom of the window is the number of characters you have.
Easy way? Copy the text and paste it to a counting script, like this site:
http://charcount.com/
(Warning: the site's background may hurt your eyes.)
Eclipse does support a Selection object, if you're into its API:
http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html#example
I have some code in Netbeans 6.1 editor that looks like this
fooString(8)
fooString(8)
fooString(8)
fooString(8)
foostring2(8)
foostring3(8)
foostring4(8)
foostring5(8)
foostring6(8)
foostring7(8)
foostring7(9)
foostring7(10)
foostring7(11)
foostring7(12)
and i want to convert it to
fooString(1)
fooString(2)
fooString(3)
fooString(4)
foostring2(5)
foostring3(6)
foostring4(7)
foostring5(8)
foostring6(9)
foostring7(10)
foostring7(11)
foostring7(12)
foostring7(13)
foostring7(14)
Is there a way e.g with regular expresions or anything else to do the job?
Thank you
Do you want to do this programmatically? If not, then I'd do the following
Use regular expression to insert a tab around the number so (8) becomes (\t8\t)
Copy this to an Excel sheet. The tab would arrange the numbers in a separate column i.e. excel will look something like this.
A B C
foostring( 8 )
foostring1( 8 )
foostring2( 8 )
etc.
Now change the values in column B. Just type 1 and 2 in the first 2 rows and drag down to fill the rset of rows.
Copy back to netbeans editor and remove the tabs inserted in step 1.