Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

Post History

60%
+1 −0
Q&A In Word, how do I readily sort a string of numbers separated by commas?

You can't do that in Word. Word's Sort command operates on "fields" in separate rows. It is nominally for Tables, but if the selected data is not in an actual Table then it treats each row of text...

posted 11mo ago by manassehkatz‭

Answer
#1: Initial revision by user avatar manassehkatz‭ · 2023-06-15T15:44:21Z (11 months ago)
You can't do that in Word.

Word's Sort command operates on "fields" in separate rows. It is nominally for Tables, but if the selected data is not in an actual Table then it treats each row of text as if it were a row of a Table. Note that each row here is a full Paragraph, defined by a hard return, *not* a line as defined by text flowing between margins.

There is an option for separating fields by commas, but that is for selecting which field within each row is sorted. For example, if your text is:

<pre>a,1,2
b,10,20
c,5,10
d,7,25
</pre>

then if you sort by Paragraph or by Field 1 then it will sort as shown. If you select Field 2 then it will sort to:

<pre>a,1,2
c,5,10
d,7,25
b,10,20
</pre>

and if you select Field 3 then it will sort to:

<pre>a,1,2
c,5,10
b,10,20
d,7,25
</pre>

It just doesn't seem to have any way to sort within a row. This is consistent with the general and historical usage of CSV/comma-delimited data as database data - each row is a record and sorting is typically via a numbered field within the rows.

If you have a large pre-existing data set consisting of a single long row of comma-delimited data, you can search/replace to change **,** to Paragraph Mark (select from Special or enter **^p**) and then Sort the results.