I’ve a big file with lines that look like
2 No route to specified transit
network3 No route to destination
i.e. a number at the start of a line followed by a description.
And I’d like to transform that for use as a struct initializer
{2,”No route to specified transit
network”},{3,”No route to destination”},
How would I do this ?
Try
This uses search-and-replace and searches for a line starting with a digit, followed by whitespace, followed by arbitrary text until the end of the line. This is replaced by the pattern you specified.
Or, using “more magic” (thanks to Al in the comments):