Jump to content
Macro Express Forums

Split by New line


Recommended Posts

I am trying to open my different accounts and I have them in order of website link, Login, and Password. I want to create a macro to open all the Links and insert password and emails. However it takes so long to go to each cell to copy that I want to copy the full column and split by new line. Is this possible and if not whats a proficient way  to go about this?

Link to comment
Share on other sites

I have these lines in a macro that uses a few special characters.  See the setting of variable T92 to the New Line value.  Once you have set the value, I think you could split using %T92%.

//  
// Tab character ascii 9
Variable Set %T91% to ASCII Char of 9
//
// Line Feed (New Line) character ascii 10
Variable Set %T92% to ASCII Char of 10
//
// Carriage Return character ascii 13
Variable Set %T93% to ASCII Char of 13
//
// Carriage Return / Line Feed combination characters ascii 13 + ascii 10
Variable Set %T94% to ASCII Char of 13
Variable Modify String: Append %T92% to %T94%
// 

Link to comment
Share on other sites

I have it as:

Link Login Password

Link Login Password

Link Login Password

Link Login Password

Link Login Password

it is in a macro and want to copy column and separate each Login and Passwords. Rberq how would I be able to apply that into the Macro?

Link to comment
Share on other sites

Just for fun, I wrote this, which assumes the three values appear in one cell separated by a space.

Clipboard Copy
Variable Set String %Clip% from the clipboard contents
Split String "%Clip%" on " " into %Results%, starting at 1
Text Box Display:

<CLIPBOARD COPY/>
<VARIABLE SET STRING Option="\x02" Destination="%Clip%" NoEmbeddedVars="FALSE"/>
<SPLIT STRING Source="%Clip%" SplitChar=" " Dest="%Results%" Index="1"/>
<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %Results[1]%\r\n\\par %Results[2]%\r\n\\par %Results[3]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

 

 

 

Link to comment
Share on other sites

In Excel, I assume each "Link Login Password" is a single row.  But is it one column with spaces between the items, or is it three columns?  (I'm asking pretty much the same question that acantor asked, above.)  It will make a difference as to the easiest way to isolate the individual items. 

Link to comment
Share on other sites

I don't like T variables. You're using MEP then you should use named variables. Like this. I typically remove all occurrences of one of the, sat the CarrigeReturn then I split on LineFeed. Then each row with tabs. Assuming the cells you're speaking of are in Excel.  

Link to comment
Share on other sites

1 hour ago, RaulB said:

thank you, "Variable Set to ASCII Char 10 to %T92%" and then split string by %T92%, worked to separate the copied string by the new line. 

Then if you have split out the lines, next step is to split out link/login/password.  My guess is, the Tab character is inserted by Excel between the items, so that can be used for splitting.  Tab character in my example code was placed into variable %T91%. 

Cory is right, it's sometimes easier to use variables with meaningful names, but I use Macro Express Version 3 that only allows T for text variables, N for integers, and D for decimal. 

Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...