Formatting numbers into a grid

Hi,
I've a grid of 20 by 20 2-digit numbers that are separated by spaces. I am wondering how to convert these to a two-dimensional array to work with as a matrix. Manually putting in commas and brackets seems a waste of time; is there an easier solution?
Thank you.

Actually it isn't too difficult to manually put those in if it is a one time ordeal.
Search " " and replace with ",". Then use a regular expression search "^(.*)$" and replace with "{\1}"
Last edited on
I can see how to do the first part; however the second search confuses me. What does it mean?
Tutorial for regex search and replace in Notepad++:
https://www.youtube.com/watch?v=PVDxg8VcidA

Regex tutorial:
http://www.regular-expressions.info/tutorial.html

Edit: I found a shorter youtube video showing Notepad++ regex.
https://www.youtube.com/watch?v=LYzUDmBBIUY

In summary, you may want to find a text editor that supports this operation. Or if you are on linux, feel free to use the stream editor sed.
Last edited on
The god. Notepad++ is the best thing I've seen in a while. Thank you.
Or if you are on linux, feel free to use the stream editor sed.

You can even use sed on Windows!

http://gnuwin32.sourceforge.net/packages/sed.htm.

Andy
You can even use sed on Windows!

I always assume that people who ask for basic help do not know how to set the PATH variable on Windows.
Topic archived. No new replies allowed.