daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Jan 20th, 2017 186 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 3869|Jennifer Smith
  2. 10413 NE 71st Street
  3. Vancouver, WA
  4. 98662
  5. 360-944-9578
  6. jsmith@yahoo.com|1234567890123456|03-2013|123
  7. --
  8. 3875|Joan L Doe
  9. 422 1/2 14th Ave E
  10. Seattle, WA
  11. 98112
  12. 206-322-7666
  13. jldoe@comcast.net|1234-1234-1234-1234|03-2013|123
  14. --
  15. 3862|Dana Doe
  16. 24235 NE 7th Pl
  17. Sammamish, WA
  18. 98074
  19. 425 868-2227
  20. jsmith@hotmail.com|1234567890123456|03-2013|123
  21. --
  22. 3890|John Smith
  23. 10470 SW 67th Ave
  24. Tigard, OR
  25. 97223
  26. 5032205213
  27. john.smith@gmail.com|1234567890123456|03-2013|123
  28.    
  29. 3869|Jennifer Smith|10413 NE 71st Street|Vancouver, WA|98662|360-944-9578|jsmith@yahoo.com|1234567890123456|03-2013|123
  30. 3875|Joan L Doe|422 1/2 14th Ave E|Seattle, WA|98112|206-322-7666|jldoe@comcast.net|1234-1234-1234-1234|03-2013|123
  31. 3862|Dana Doe|24235 NE 7th Pl|Sammamish, WA|98074|425 868-2227|jsmith@hotmail.com|1234567890123456|03-2013|123
  32. 3890|John Smith|10470 SW 67th Ave|Tigard, OR|97223|5032205213|john.smith@gmail.com|1234567890123456|03-2013|123
  33.    
  34. 3869|Jennifer Smith|10413 NE 71st Street|Vancouver|WA|98662|360-944-9578|jsmith@yahoo.com|1234567890123456|03-2013|123
  35. 3875|Joan L Doe|422 1/2 14th Ave E|Seattle|WA|98112|206-322-7666|jldoe@comcast.net|1234-1234-1234-1234|03-2013|123
  36. 3862|Dana Doe|24235 NE 7th Pl|Sammamish|WA|98074|425 868-2227|jsmith@hotmail.com|1234567890123456|03-2013|123
  37. 3890|John Smith|10470 SW 67th Ave|Tigard|OR|97223|5032205213|john.smith@gmail.com|1234567890123456|03-2013|123
  38.    
  39. $ awk '{if (/^--/) {print a; a=""} else { a=a"|"$0}}' file
  40. |3869|Jennifer Smith|10413 NE 71st Street|Vancouver, WA|98662|360-944-9578|jsmith@yahoo.com|1234567890123456|03-2013|123
  41. |3875|Joan L Doe|422 1/2 14th Ave E|Seattle, WA|98112|206-322-7666|jldoe@comcast.net|1234-1234-1234-1234|03-2013|123
  42. |3862|Dana Doe|24235 NE 7th Pl|Sammamish, WA|98074|425 868-2227|jsmith@hotmail.com|1234567890123456|03-2013|123
  43.    
  44. --
  45.    
  46. $ awk '{if (/^--/) {print a; a=""} else { a=a"|"$0}}' file
  47. |3869|Jennifer Smith|10413 NE 71st Street|Vancouver, WA|98662|360-944-9578|jsmith@yahoo.com|1234567890123456|03-2013|123
  48. |3875|Joan L Doe|422 1/2 14th Ave E|Seattle, WA|98112|206-322-7666|jldoe@comcast.net|1234-1234-1234-1234|03-2013|123
  49. |3862|Dana Doe|24235 NE 7th Pl|Sammamish, WA|98074|425 868-2227|jsmith@hotmail.com|1234567890123456|03-2013|123
  50. |3890|John Smith|10470 SW 67th Ave|Tigard, OR|97223|5032205213|john.smith@gmail.com|1234567890123456|03-2013|123
  51.    
  52. sed -n ':a;$!N;/--/!s/n/|/g;ta;P' inputFile
  53.  
  54.  
  55. $ sed -n ':a;$!N;/--/!s/n/|/g;ta;P' temp
  56. 3869|Jennifer Smith|10413 NE 71st Street|Vancouver, WA|98662|360-944-9578|jsmith@yahoo.com|1234567890123456|03-2013|123
  57. 3875|Joan L Doe|422 1/2 14th Ave E|Seattle, WA|98112|206-322-7666|jldoe@comcast.net|1234-1234-1234-1234|03-2013|123
  58. 3862|Dana Doe|24235 NE 7th Pl|Sammamish, WA|98074|425 868-2227|jsmith@hotmail.com|1234567890123456|03-2013|123
  59. 3890|John Smith|10470 SW 67th Ave|Tigard, OR|97223|5032205213|john.smith@gmail.com|1234567890123456|03-2013|123
  60.    
  61. awk -F'n' -vRS='n--n' -vOFS='|' '{$1=$1;print}' test.in
  62.    
  63. awk -F'n' -vRS='n--n' -vOFS='|' '{if($NF==""){NF--}$1=$1;print}' test.in
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top