Comma separated values (literally, not csv) in the same cell in excel, put in individual cells
up vote
2
down vote
favorite
I have a column of cells in excel which contain mails, some only contain one mail as they should but others, have more than one email per cell in this format:
one@example.com, two@example.com, three@example.com
What I want to achieve is getting them like this:
one@example.com
two@example.com
three@example.com
I´m guessing (don´t take my word on it) you could do some kind of if statement along the lines of
if (cell contains ", ")
get string from ", " to ", " and paste somehow
else "b1"
You may be screaming at your screen right now :) (or laughing) but it´s just how would approach it, no idea of the functions to be used or if it is even possible this way.
So if you have any ideas I appreciate it!!
Just in case, I want to do a csv out of this file so, any workaround that would get this done would do...
Thanks in advance!
Trufa
BTW I hope I have explained the problem clear enough if not please ask for clarifications!
EDIT: The problem is actually solved, I gave in and did it one by one, the one method that never fails you :)
Iwpuld appreciate any ideas anyway for the future and for knowledge sake!
microsoft-excel csv ordering cells
add a comment |
up vote
2
down vote
favorite
I have a column of cells in excel which contain mails, some only contain one mail as they should but others, have more than one email per cell in this format:
one@example.com, two@example.com, three@example.com
What I want to achieve is getting them like this:
one@example.com
two@example.com
three@example.com
I´m guessing (don´t take my word on it) you could do some kind of if statement along the lines of
if (cell contains ", ")
get string from ", " to ", " and paste somehow
else "b1"
You may be screaming at your screen right now :) (or laughing) but it´s just how would approach it, no idea of the functions to be used or if it is even possible this way.
So if you have any ideas I appreciate it!!
Just in case, I want to do a csv out of this file so, any workaround that would get this done would do...
Thanks in advance!
Trufa
BTW I hope I have explained the problem clear enough if not please ask for clarifications!
EDIT: The problem is actually solved, I gave in and did it one by one, the one method that never fails you :)
Iwpuld appreciate any ideas anyway for the future and for knowledge sake!
microsoft-excel csv ordering cells
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a column of cells in excel which contain mails, some only contain one mail as they should but others, have more than one email per cell in this format:
one@example.com, two@example.com, three@example.com
What I want to achieve is getting them like this:
one@example.com
two@example.com
three@example.com
I´m guessing (don´t take my word on it) you could do some kind of if statement along the lines of
if (cell contains ", ")
get string from ", " to ", " and paste somehow
else "b1"
You may be screaming at your screen right now :) (or laughing) but it´s just how would approach it, no idea of the functions to be used or if it is even possible this way.
So if you have any ideas I appreciate it!!
Just in case, I want to do a csv out of this file so, any workaround that would get this done would do...
Thanks in advance!
Trufa
BTW I hope I have explained the problem clear enough if not please ask for clarifications!
EDIT: The problem is actually solved, I gave in and did it one by one, the one method that never fails you :)
Iwpuld appreciate any ideas anyway for the future and for knowledge sake!
microsoft-excel csv ordering cells
I have a column of cells in excel which contain mails, some only contain one mail as they should but others, have more than one email per cell in this format:
one@example.com, two@example.com, three@example.com
What I want to achieve is getting them like this:
one@example.com
two@example.com
three@example.com
I´m guessing (don´t take my word on it) you could do some kind of if statement along the lines of
if (cell contains ", ")
get string from ", " to ", " and paste somehow
else "b1"
You may be screaming at your screen right now :) (or laughing) but it´s just how would approach it, no idea of the functions to be used or if it is even possible this way.
So if you have any ideas I appreciate it!!
Just in case, I want to do a csv out of this file so, any workaround that would get this done would do...
Thanks in advance!
Trufa
BTW I hope I have explained the problem clear enough if not please ask for clarifications!
EDIT: The problem is actually solved, I gave in and did it one by one, the one method that never fails you :)
Iwpuld appreciate any ideas anyway for the future and for knowledge sake!
microsoft-excel csv ordering cells
microsoft-excel csv ordering cells
edited Oct 23 '10 at 1:34
asked Oct 22 '10 at 17:46
Trufa
1172318
1172318
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
up vote
2
down vote
Within Excel, try Data -> Text to Columns.
Then choose "," as the delimiter. This will put column breaks where the commas are now.
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
add a comment |
up vote
0
down vote
Can't you just save as a CSV and do a search and replace for ,
to n
?
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
@Trufa: It's not; I usedn
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.
– Hello71
Oct 22 '10 at 18:31
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
add a comment |
up vote
0
down vote
Export your Excel file to a csv.
Copy it across to a Linux machine and edit it in Vim editor.
Then type:
%s/,/\n/g
This is the breakdown of that command:
: - run command
%s - substitute
/ - separator
, - string to find
/ - separator- **** - a control character to ignore the next character, but in this case we want the following n part to be the string it replaces the comma with
n - string to replace comma with
/ - separator
g - globally
This will find and replace the commas with a line break globally and put every cell onto a new line. You can then reimport this file into Excel.
Apologies if you dont use Linux - that is my speciality and the editor and string manipulation tools are much better than on Windows.
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
add a comment |
up vote
0
down vote
I'm not sure if my answer fits in here since it's more of a Stackoverflow answer, but you could write a macro to do it fairly easily. For example, the following macro would assume that the current email addresses are in the first column and would copy them to the second column:
Cells(1, 1).Select
Dim curr As String
Dim cnt As Integer
cnt = 0
For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
curr = Cells(i, 1).Value
If InStr(curr, "@") Then
If InStr(curr, ",") Then
Dim tmp() As String
tmp = Split(curr, ",")
For j = LBound(tmp) To UBound(tmp)
cnt = cnt + 1
Cells(cnt, 2).Value = tmp(j)
Next
Else
cnt = cnt + 1
Cells(cnt, 2).Value = curr
End If
End If
Next i
I don't know VBA that much though, so might be better ways of doing it.
add a comment |
up vote
0
down vote
So you want the line breaks instead of commas, then you need to find and replace them with char(10). Try this formula.
=SUBSTITUTE(A2,",",CHAR(10))
The formula will replace commas from the text in A2 and replace them with a line break.
Eg: If A2 contains:
someone@gmail.com,somebody@yahoo.com
then it will return as:
someone@gmail.com
somebody@yahoo.com
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Within Excel, try Data -> Text to Columns.
Then choose "," as the delimiter. This will put column breaks where the commas are now.
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
add a comment |
up vote
2
down vote
Within Excel, try Data -> Text to Columns.
Then choose "," as the delimiter. This will put column breaks where the commas are now.
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
add a comment |
up vote
2
down vote
up vote
2
down vote
Within Excel, try Data -> Text to Columns.
Then choose "," as the delimiter. This will put column breaks where the commas are now.
Within Excel, try Data -> Text to Columns.
Then choose "," as the delimiter. This will put column breaks where the commas are now.
edited Dec 22 '11 at 7:02
soandos
20.1k2791130
20.1k2791130
answered Oct 22 '10 at 19:03
Larry C
30112
30112
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
add a comment |
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:30
add a comment |
up vote
0
down vote
Can't you just save as a CSV and do a search and replace for ,
to n
?
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
@Trufa: It's not; I usedn
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.
– Hello71
Oct 22 '10 at 18:31
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
add a comment |
up vote
0
down vote
Can't you just save as a CSV and do a search and replace for ,
to n
?
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
@Trufa: It's not; I usedn
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.
– Hello71
Oct 22 '10 at 18:31
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
add a comment |
up vote
0
down vote
up vote
0
down vote
Can't you just save as a CSV and do a search and replace for ,
to n
?
Can't you just save as a CSV and do a search and replace for ,
to n
?
answered Oct 22 '10 at 18:10
Hello71
7,09433342
7,09433342
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
@Trufa: It's not; I usedn
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.
– Hello71
Oct 22 '10 at 18:31
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
add a comment |
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
@Trufa: It's not; I usedn
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.
– Hello71
Oct 22 '10 at 18:31
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
So, n is valid in a csv file, it will undestand?
– Trufa
Oct 22 '10 at 18:17
@Trufa: It's not; I used
n
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.– Hello71
Oct 22 '10 at 18:31
@Trufa: It's not; I used
n
as a placeholder for a line break in Notepad++. You'll have to find out what a line break is represented as in search and replace in your text editor.– Hello71
Oct 22 '10 at 18:31
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
I conuldt find a way to do that! thanks anyway look at my edit please :)
– Trufa
Oct 23 '10 at 1:29
add a comment |
up vote
0
down vote
Export your Excel file to a csv.
Copy it across to a Linux machine and edit it in Vim editor.
Then type:
%s/,/\n/g
This is the breakdown of that command:
: - run command
%s - substitute
/ - separator
, - string to find
/ - separator- **** - a control character to ignore the next character, but in this case we want the following n part to be the string it replaces the comma with
n - string to replace comma with
/ - separator
g - globally
This will find and replace the commas with a line break globally and put every cell onto a new line. You can then reimport this file into Excel.
Apologies if you dont use Linux - that is my speciality and the editor and string manipulation tools are much better than on Windows.
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
add a comment |
up vote
0
down vote
Export your Excel file to a csv.
Copy it across to a Linux machine and edit it in Vim editor.
Then type:
%s/,/\n/g
This is the breakdown of that command:
: - run command
%s - substitute
/ - separator
, - string to find
/ - separator- **** - a control character to ignore the next character, but in this case we want the following n part to be the string it replaces the comma with
n - string to replace comma with
/ - separator
g - globally
This will find and replace the commas with a line break globally and put every cell onto a new line. You can then reimport this file into Excel.
Apologies if you dont use Linux - that is my speciality and the editor and string manipulation tools are much better than on Windows.
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
add a comment |
up vote
0
down vote
up vote
0
down vote
Export your Excel file to a csv.
Copy it across to a Linux machine and edit it in Vim editor.
Then type:
%s/,/\n/g
This is the breakdown of that command:
: - run command
%s - substitute
/ - separator
, - string to find
/ - separator- **** - a control character to ignore the next character, but in this case we want the following n part to be the string it replaces the comma with
n - string to replace comma with
/ - separator
g - globally
This will find and replace the commas with a line break globally and put every cell onto a new line. You can then reimport this file into Excel.
Apologies if you dont use Linux - that is my speciality and the editor and string manipulation tools are much better than on Windows.
Export your Excel file to a csv.
Copy it across to a Linux machine and edit it in Vim editor.
Then type:
%s/,/\n/g
This is the breakdown of that command:
: - run command
%s - substitute
/ - separator
, - string to find
/ - separator- **** - a control character to ignore the next character, but in this case we want the following n part to be the string it replaces the comma with
n - string to replace comma with
/ - separator
g - globally
This will find and replace the commas with a line break globally and put every cell onto a new line. You can then reimport this file into Excel.
Apologies if you dont use Linux - that is my speciality and the editor and string manipulation tools are much better than on Windows.
edited Dec 22 '11 at 8:36
3498DB
15.6k114762
15.6k114762
answered Apr 21 '11 at 6:29
Chris
91
91
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
add a comment |
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
Notepad++ also handles regex search and replace, and runs on windows. I use it regularly for cases like this.
– glallen
Jun 20 '12 at 16:22
add a comment |
up vote
0
down vote
I'm not sure if my answer fits in here since it's more of a Stackoverflow answer, but you could write a macro to do it fairly easily. For example, the following macro would assume that the current email addresses are in the first column and would copy them to the second column:
Cells(1, 1).Select
Dim curr As String
Dim cnt As Integer
cnt = 0
For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
curr = Cells(i, 1).Value
If InStr(curr, "@") Then
If InStr(curr, ",") Then
Dim tmp() As String
tmp = Split(curr, ",")
For j = LBound(tmp) To UBound(tmp)
cnt = cnt + 1
Cells(cnt, 2).Value = tmp(j)
Next
Else
cnt = cnt + 1
Cells(cnt, 2).Value = curr
End If
End If
Next i
I don't know VBA that much though, so might be better ways of doing it.
add a comment |
up vote
0
down vote
I'm not sure if my answer fits in here since it's more of a Stackoverflow answer, but you could write a macro to do it fairly easily. For example, the following macro would assume that the current email addresses are in the first column and would copy them to the second column:
Cells(1, 1).Select
Dim curr As String
Dim cnt As Integer
cnt = 0
For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
curr = Cells(i, 1).Value
If InStr(curr, "@") Then
If InStr(curr, ",") Then
Dim tmp() As String
tmp = Split(curr, ",")
For j = LBound(tmp) To UBound(tmp)
cnt = cnt + 1
Cells(cnt, 2).Value = tmp(j)
Next
Else
cnt = cnt + 1
Cells(cnt, 2).Value = curr
End If
End If
Next i
I don't know VBA that much though, so might be better ways of doing it.
add a comment |
up vote
0
down vote
up vote
0
down vote
I'm not sure if my answer fits in here since it's more of a Stackoverflow answer, but you could write a macro to do it fairly easily. For example, the following macro would assume that the current email addresses are in the first column and would copy them to the second column:
Cells(1, 1).Select
Dim curr As String
Dim cnt As Integer
cnt = 0
For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
curr = Cells(i, 1).Value
If InStr(curr, "@") Then
If InStr(curr, ",") Then
Dim tmp() As String
tmp = Split(curr, ",")
For j = LBound(tmp) To UBound(tmp)
cnt = cnt + 1
Cells(cnt, 2).Value = tmp(j)
Next
Else
cnt = cnt + 1
Cells(cnt, 2).Value = curr
End If
End If
Next i
I don't know VBA that much though, so might be better ways of doing it.
I'm not sure if my answer fits in here since it's more of a Stackoverflow answer, but you could write a macro to do it fairly easily. For example, the following macro would assume that the current email addresses are in the first column and would copy them to the second column:
Cells(1, 1).Select
Dim curr As String
Dim cnt As Integer
cnt = 0
For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
curr = Cells(i, 1).Value
If InStr(curr, "@") Then
If InStr(curr, ",") Then
Dim tmp() As String
tmp = Split(curr, ",")
For j = LBound(tmp) To UBound(tmp)
cnt = cnt + 1
Cells(cnt, 2).Value = tmp(j)
Next
Else
cnt = cnt + 1
Cells(cnt, 2).Value = curr
End If
End If
Next i
I don't know VBA that much though, so might be better ways of doing it.
answered Dec 22 '11 at 9:05
ho1
28329
28329
add a comment |
add a comment |
up vote
0
down vote
So you want the line breaks instead of commas, then you need to find and replace them with char(10). Try this formula.
=SUBSTITUTE(A2,",",CHAR(10))
The formula will replace commas from the text in A2 and replace them with a line break.
Eg: If A2 contains:
someone@gmail.com,somebody@yahoo.com
then it will return as:
someone@gmail.com
somebody@yahoo.com
add a comment |
up vote
0
down vote
So you want the line breaks instead of commas, then you need to find and replace them with char(10). Try this formula.
=SUBSTITUTE(A2,",",CHAR(10))
The formula will replace commas from the text in A2 and replace them with a line break.
Eg: If A2 contains:
someone@gmail.com,somebody@yahoo.com
then it will return as:
someone@gmail.com
somebody@yahoo.com
add a comment |
up vote
0
down vote
up vote
0
down vote
So you want the line breaks instead of commas, then you need to find and replace them with char(10). Try this formula.
=SUBSTITUTE(A2,",",CHAR(10))
The formula will replace commas from the text in A2 and replace them with a line break.
Eg: If A2 contains:
someone@gmail.com,somebody@yahoo.com
then it will return as:
someone@gmail.com
somebody@yahoo.com
So you want the line breaks instead of commas, then you need to find and replace them with char(10). Try this formula.
=SUBSTITUTE(A2,",",CHAR(10))
The formula will replace commas from the text in A2 and replace them with a line break.
Eg: If A2 contains:
someone@gmail.com,somebody@yahoo.com
then it will return as:
someone@gmail.com
somebody@yahoo.com
answered Nov 21 at 4:48
nifraz
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f202395%2fcomma-separated-values-literally-not-csv-in-the-same-cell-in-excel-put-in-in%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown