so i have a file called test.txt that contain the following lines.
- The first school , located at random at 0000
- The second school , located at random at 1000
- The third school , located at random at 2000
- The fourth school , located at random at 3000
I want use sed to list the only school number and school name so the output is
- The first school
- The second school
- The third school
- The fourth school
The way im doing this by using the following command. sed 's/[,].*//' test.txt
This replaces the comma and everything after with blank spaces. Is there another way i can achieve this using only sed?