|
Help with grep and regex
Hi all,
I'm a beginner with linux, regex, grep, etc
I am trying to get data out of a file that has about 13,000 lines in this format
name - location
I want to grep all the names out to one file and the locations to another so I can put them into a spreadsheet.
Some have hyphenated names or hyphenated locations as well to complicate things.
The way I was going to approach it was to first grep out the lines with only one hypen to one file and all the ones with multiple hyphens to another.
Then I need an expression to select all data on one side of the hyphen and place it into one file, and the data on the other side of the hyphen into another file.
I'm going through all the tutorials I can find, but they don't read much better than man pages and I can't figure out how to do what I want. Can anyone help me get started with this?
Thanks in advance!
|