Replace \n char true line Separator

Tags
advanced, line, line separator, replace, separator

 
Thread Tools Search this Thread
# 1  
Old 11-22-2018
Replace \n char true line Separator

Unix File is pipe delimited with 17 fields. We may get extra pipes in data also.
We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n.

Input:
455000|TTTT|97233|UUUUUU REP||Juli||EEEE||P.O. Box | 550 MMMMMMMMMM JJ 55555|||||||
333333|DDD|97233|UUUUUU REP||AMAR||AJAY||P.O. Box 69 MMMMMMMMMM | JJ 6666
JJJ BBBB P.O. Box 4 MMMMMMMMMM JJ 44444
delmer Speidel P.O. Box 242 MMMMMMMMMM JJ 99456, See File For More.....|||||||
888888|Director|97382|UUUUUU REP||ANTHONY|K|JOSHI||1144 JNM ROAD LLLLLLLLLLLLL | JJ 82513, Laurie Ideker, Leon Sanderson
coralie Emmons P.O. Box 34 LLLLLLLLLLLLL JJ 82513
wanda Knowles P.O. Box 958 LLLLLLLLLLLLL JJ 82513, See File For More...|||||||
999999|President|97692|UUUUUU REP||See||File|||||||||

Expected Output:
455000|TTTT|97233|UUUUUU REP||Juli||EEEE||P.O. Box | 550 MMMMMMMMMM JJ 55555||||||| \a 333333|DDD|97233|UUUUUU REP||AMAR||AJAY||P.O. Box 69 MMMMMMMMMM | JJ 6666
JJJ BBBB P.O. Box 4 MMMMMMMMMM JJ 44444
delmer Speidel P.O. Box 242 MMMMMMMMMM JJ 99456, See File For More.....||||||| \a 888888|Director|97382|UUUUUU REP||ANTHONY|K|JOSHI||1144 JNM ROAD LLLLLLLLLLLLL | JJ 82513, Laurie Ideker, Leon Sanderson
coralie Emmons P.O. Box 34 LLLLLLLLLLLLL JJ 82513
wanda Knowles P.O. Box 958 LLLLLLLLLLLLL JJ 82513, See File For More...||||||| \a 999999|President|97692|UUUUUU REP||See||File|||||||||
# 2  
Old 11-22-2018
Moderator's Comments:
Mod Comment This thread seems to be a duplicate of the thread Replace \n char in Data. Please continue any discussion on this topic there.

This thread is closed.

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Replace \n char in Data rajeshkumare UNIX for Advanced & Expert Users 9 11-25-2018 07:41 PM
Use two field separator in the same line and print them antoniorajr Shell Programming and Scripting 4 08-11-2015 04:49 AM
How to change the line separator? baranisachin Shell Programming and Scripting 1 12-15-2014 06:48 AM
File command return wrong filetype while file holds group separator char. Arpitak29 UNIX for Advanced & Expert Users 6 06-16-2014 12:20 PM
Match a char with duplicates in a line and replace one of them redse171 Shell Programming and Scripting 5 05-22-2014 02:48 PM
How to separate one line to mutiple line based on one char? ken6503 Shell Programming and Scripting 4 06-05-2013 02:47 AM
Formatting File having big single line into 95 Char Per Line lancesunny Shell Programming and Scripting 10 11-01-2012 08:05 PM
Replace char between chars - help needed go0ogl3 Shell Programming and Scripting 10 07-07-2012 10:57 AM
Find and replace all extended char. asavaliya Shell Programming and Scripting 4 04-10-2012 02:19 PM
How to cut a line that contains two different separator naoseionome UNIX for Advanced & Expert Users 2 07-08-2011 01:12 PM
Replace char on text file phillipss Shell Programming and Scripting 2 12-11-2010 01:19 AM
In vi editor I want to replace next line char by space RahulJoshi Shell Programming and Scripting 5 09-17-2010 05:44 AM
how first char in odd line and second char in even line tarunn.dubeyy Shell Programming and Scripting 1 02-06-2010 06:23 AM
SED: Place char at starting and replace selected line hkansal Shell Programming and Scripting 2 06-11-2009 03:42 AM
How to replace any char with newline char. mightysam Shell Programming and Scripting 5 09-18-2008 09:15 PM