Emerald Editor Discussion
August 18, 2017, 02:13:15 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MACRO SUPPORT - Interesting request for help. Increment numbers in Text file  (Read 3651 times)
0 Members and 1 Guest are viewing this topic.
RedTideAtNight
Miner
**
Posts: 16


« on: October 07, 2013, 08:47:49 pm »

This began as a macro method then I thought it might work simpler with columnar copy and paste.
The macro method is looking easier.

BEGIN the macro explaination here:

A text file has urls in it like this:
http://tld.com/portfolio/view/3667

I'd like to copy the URL and increment the
number at the end beginning at any number
and increment to any number

e.g.

http://tld.com/portfolio/view/0001
http://tld.com/portfolio/view/0002
http://tld.com/portfolio/view/0003
http://tld.com/portfolio/view/0004
http://tld.com/portfolio/view/0005
http://tld.com/portfolio/view/0006
.
.
.
http://tld.com/portfolio/view/4555
http://tld.com/portfolio/view/4556
http://tld.com/portfolio/view/4557
http://tld.com/portfolio/view/4558
http://tld.com/portfolio/view/4559


If you have friends on the forum who are sharp with the macro ask them if
they'll take a whack at this. 

Also maybe you know of a forum which deals with macro logic.  I could use
the help. 

I haven't thought it through all the way yet.  My goal is to make the method
have no limits.

If I create columns and copy and paste then it's not using the MACRO.
however it's more 'work' as we seen lots of columns and rows.

What I like about using a MACRO is that there's only 10 digits in each
macro.
I think it will work this way:
Begin the macro by placing the cursor at 'the beginning' .
Then start the macro .. it will place 0 and then move down one row and place a
1. Then move down and place a 2 and so on.

What I like about this method is it's 'done' the moment you place the
cursor and start the macro.

I also began a copy and paste columns .. see this bit next to understand.
I won't finish this using the columns.  After beginning it .. it's simply 'too much
work' .. haha. 

So if you 'd like to weigh in on the macro . have some fun
and thanks!

you can send me an email here.   or at

a j a j a j
at
red i ff mail
dot
com

put that all together for the right address.

Andre


Explain the columnar copy and paste method

Begin the column copy and paste method.
The method I began with is this:

See example at bottom of this page*
Make a column of 0, 1, 2, etc to 9. *(1)

Then copy it using Alt-C (columnar mode)
Then I'll try to paste another column next to each column. 
It works, so, then a macro isn't the only way to do this.

What I like about macro is it's playing my thoughts back..
I think that's 'OK' and useful.. especially if we can get macros into lots of
new tech.

So I'm able to copy 1 column of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
where 0 is 10, 0's vertically, 1 is 10, 1's, vertically.

(imagine 10, 0's, 10, 1's, and so on.
see here:
0
1
2
3

THEN  them into 10 columns sideways like SO:

again imagine 10 of each digit
0  0  >  and so on so it's 10 digits down and 10 digits sideways.
1  1
2  2
3  3
4  4
5  5
6  6
7  7
8  8
9  9

This can be done with columnar (Alt-C) copy and paste.




*(1)
0
0
0
0
0
0
0
0
0
0

1
1
1
1
1
1
1
1
1
Logged
jeff.marsh
Prospector
*
Posts: 6


« Reply #1 on: November 21, 2013, 06:24:04 am »

Thanks for the challenge - I live and breath to write macros in Crimson - there isn't much you can't do - as with the rest of this program Ingyu did a great job.  Removing CR/LF with search and replace is the only thing I've never been able to do and had to copy and paste to another program to do easily.  Anyhow, apologies for the delay - as there isn't much happening I only stop by every few months - you've probably already figured it out on your own but here is a macro approach that should work if I understand the problem correctly.  Basically you want to use the Evaluate line function to increment.  I've tested the macro out and it works the only question is whether I've typed the steps in correctly (That's a lot harder than actually recording it!)

[Place cursor at beginning of line to copy and increment and start macro recording]
Shift-<End>
Ctrl-c
<End>
<Enter>
Ctrl-v
<End>
Ctrl-F for / Direction Up
<Cursor right>
<Enter>
<End>
+1
Ctrl-<Enter>
Ctrl-F for " " Direction Up
Shift-<Home>
<Delete>
Shift-<Up>
<Delete>
<Backspace>
<Home>
[End Macro Recording]
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.21 seconds with 18 queries.