Try (even though your required output does NOT fit the sample input given):
Adapt to your needs, esp. the field separator assignment; works as is on linux/mawk.
Hi Everybody,
I need some help on formatting the files coming into unix box on the fly.
I get a file some thing like this in a single line.
ISA^M00^M ^M00^M ^M14^M006929681900 ^M01^M095449419 ... (5 Replies)
Hello ,
I have the folowing scenario :
I have a text file as follows : (say name.txt)
ABC
DEF
XYZ
And I have one more xml file as follows : (say somexml.xml)
<Name>ABC</Name>
<Age>12</Age>
<Class>D</Class>
<Name>XYZ</Name>
<Age>12</Age>
<Class>D</Class>
<Name>DEF</Name>... (7 Replies)
I found that when I used a variable to receive the result from a command execution, the newline characters were removed from the variable.
For example, I ran
$ ret=`ls -l`
$ echo $ret
Then, I saw:
total 40 -rw-r--r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk -rw-rw-r-- 1 testtrunk... (2 Replies)
Hello,
I am currently trying to edit an ldif file. The ldif specification states that a newline followed by a space indicates the subsequent line is a continuation of the line. So, in order to search and replace properly and edit the file, I open the file in textwrangler, search for "\r " and... (14 Replies)
I have
a='123, abc, def, ghi'
var1=`echo $a | awk -F", " '{print RS $1}'`
echo "something: $var1"
which outputs
something
123
how can I tell awk not to put a newline between fields? I want it to output:
something: 123 (4 Replies)
I have a csv file which is produced out of a SED command sed 's/|/","/g; s/^/"/; s/$/"/' A4.txt > A5.csv and I need either an addition to the SED command or a separate command to convert the following characters which occur within the fields in multiple lines
1) "=" to ="
and
2)""~ to " (4 Replies)
Hi All,
I receive a | delimited text file containing 63 columns. There is no delimiter at the end of the 63rd field, instead there would be a newline character at the end of the text in 63rd column. I wanted to retain this newline character at the end of the 63rd column, as it is desired newline... (1 Reply)
Hi,
Text file has DEL character(ASCII code 127) as quotes with comma as field delimiter. If any of the field contains new line character then I need to remove it. Please help me to achieve this.
Thanks
Vikram (4 Replies)
Hi All, I am a newbie to Shell scripting. I have a requirement to Delimit the file fields of a Input file having special characters and spaces with ";".
Input File
----------------------------------
Server Port
----------------------------------
Local ... (5 Replies)