OK, so here's what I'm trying to do. I've got a file with, for example, the following lines:
Code:
First_Name: John
Last_Name: Smith
Address: 123 Anywhere
Phone: 555-5555
First_Name: Jane
Last_Name: Jones
Address: 321 Anywhere
Phone:111-1111
I'm trying to use sed to place each line from First_Name: to Phone: on a single line delimited by tabs, and then the next "First_Name" block on its own line with the same tab delimited fields. However, I just can't seem to figure out the right expression. If I use
sed 's/First_Name*\n/\t/g' foo > bar
nothing happens. Just using sed 's/\n/\t/g' gives me nothing, as if there are no newline characters in this text file at all, when there clearly are.
Anyone have any ideas? I've also tried to outright delete newline characters with sed '/\n/d' and nothing happens. If I use sed '/$/d', however, it erases the contents of the entire file, when I'm only interested in deleting the final end-of-line character, the newline.
Can anyone help?