Complete.Org: Mailing Lists: Archives: linux-help: August 2001:
[linux-help] Re: ahhh, anyone got an answer to this one please
Home

[linux-help] Re: ahhh, anyone got an answer to this one please

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: <linux-help@xxxxxxxxx>
Subject: [linux-help] Re: ahhh, anyone got an answer to this one please
From: "Peter Wang" <pwang@xxxxxxxxxxxxxx>
Date: Mon, 20 Aug 2001 18:37:01 -0400
Reply-to: linux-help@xxxxxxxxx

The problem can solve by using dos2unix command. Do man on dos2unix. Or
adding #!/usr/bin/perl -x replaces #!/usr/bin/perl to solve the problem. The
first one is clear and easy.

Have a nice day!

-----Original Message-----
From: linux-help-bounce@xxxxxxxxx [mailto:linux-help-bounce@xxxxxxxxx]On
Behalf Of aaa.comms
Sent: Monday, August 20, 2001 6:08 PM
To: linux-help@xxxxxxxxx
Subject: [linux-help] ahhh, anyone got an answer to this one please



If anyone has a clue as to answer to this then my boss will love you
forever, come to that I would be very, very grateful.
o.k. here is the conundrum
I have a load of files and they are all .xml, need to treat them in bash.
(With perl ? or anything else that works for that matter.)
Each .xml file has a load of elements <value> the end of each line
terminates with a "M$" (No problems there)
the EOF signature is as follows          ^@     not     ^@$     I have to push 
this back into
a parser so as it can be read, and it crashes with the $.
The issue is creating the ^@ at the end of the file, if I > I add a $, tried
pipeing it through all manner of things and can't get rid of the $
At the prompt # echo -e "\0" |cat -A |tr -d '\044' produces ^@ in octal
(94=^ and 64=@) tried that route too
But if I # echo -e "\0" |cat -A |tr -d '\044' >file I get the $ back and I
need to close the file with ^@
But have failed to the point of bad headaches, tried sed and it will copy
the file over with the ^@ and no $, but I need to do a lot in each file and
can see the sed script getting out of hand append, insert, would also need
to use H and G.
All I need is to be able to get cat -A to show ^@ at the EOF, so I am happy
it will go through the parser any ideas?
Please.......
Yours Alan.r.b a.k.a Mr. Down Right Sad
P.s The guy who wrote the C parser has left, we need to get this out for a
client, and I am stuck in C code of the length >60,000 lines, took him 11
months and he knew what he was doing.


-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi

-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]