Create Two New Columns From Data in Single Column
Posted: 03 Jan 2018 14:16
Hello DOSTips list,
We got a request for one that I am really struggling with:
We get lots of TXT files with user name and passwords, one account per line and some character (often a colon) separating the username and password, such as
jack.thehill@domain.com:jack'spassword
jill.thehill@website.com:jill'spassword
We are needing to get the batch to process it so the original displays, followed by a COMMA, followed by the EMAIL ADDRESS, followed by a COMMA, followed by the PASSWORD
jack.thehill@domain.com:jack'spassword,jack.thehill@domain.com,jack'spassword
jill.thehill@website.com:jill'spassword,jill.thehill@website.com,jill'spassword
Since the files could potentially have different characters that separate the EMAIL ADDRESS from the PASSWORD we will probably just need to SET a variable each time we run it, such as:
set separator=: (or possibly set separator=^:) as I cannot remember if the ":" is a special character.
This really has me scratching my head on how to do this, any advice would be greatly appreciated.
Aisha
We got a request for one that I am really struggling with:
We get lots of TXT files with user name and passwords, one account per line and some character (often a colon) separating the username and password, such as
jack.thehill@domain.com:jack'spassword
jill.thehill@website.com:jill'spassword
We are needing to get the batch to process it so the original displays, followed by a COMMA, followed by the EMAIL ADDRESS, followed by a COMMA, followed by the PASSWORD
jack.thehill@domain.com:jack'spassword,jack.thehill@domain.com,jack'spassword
jill.thehill@website.com:jill'spassword,jill.thehill@website.com,jill'spassword
Since the files could potentially have different characters that separate the EMAIL ADDRESS from the PASSWORD we will probably just need to SET a variable each time we run it, such as:
set separator=: (or possibly set separator=^:) as I cannot remember if the ":" is a special character.
This really has me scratching my head on how to do this, any advice would be greatly appreciated.
Aisha