473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Removing " ^@ " from a file

I have a file on my Linux box that has this strange control character
combination (^@) in it at the beginning of every line. I can only
remove this from VI. I have tried using sed, tr, and others to remove
it, but none work. How can I remove this control character sequence
via PHP??

^@^@
^@^@ DPCA ALIASI ALIASN/N24 CLLI LSN RC
APCA
^@^@ 208-000-000 ------- ----------- alias208000 bi403239 0
208-001-000
^@^@ bi403240 0
208-002-000
^@^@ cc403000 10
235-002-000
^@^@ 235-243-002 ------- ----------- ----------- bn403131 0
235-007-000
^@^@ bn403132 0
235-006-000
^@^@ cc403000 2
235-002-000
^@^@ 226-251-070 ------- ----------- vancbcxpgt0 bm403044 0
226-008-000

Any suggestions would be greatly appreciated. Stuff like ^D and ^M are
easy. They can be removed with regular expressions. However, this ^@
sequence just refuses to budge.

Alternatively, does anyone have any suggestions on how I can avoid
getting it in the first place? I obtain this file by telneting from a
linux (red hat) command prompt to a Tekelec Eagle STP with the output
piped to a file. The same thing happens when I telnet to this box
using Expect.

Jul 17 '05 #1
1 1364
I finally found it! Thanks to reading a post just a few hours before
my post. The answer was :

$line = preg_replace('[\c@]','',$line);

I found this thanks to Kenneth Downs in his response to the post : "
regexp to leave only alpha/numeric chars"

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Karl Seguin | last post by:
Some of our users behind firewalls (watchguard in particular) are reporting that they can't access our site. This is the type of error they are getting: 02/06/04 07:27 http-proxy: removing...
3
by: Libra Blue | last post by:
I try to set the page title dynamically in an aspx page, but sometimes an error occurs due to VS removing the runat="server" attribute at its own will... How do I stop from doing so?? Libra Blue
7
by: Brad | last post by:
I'm placing a runat=server attribute on the <title> tag in my pages, so I can read/set the title text in code. The problem is that when I subsequently change the page in design view VS is...
11
by: Embrion | last post by:
Hello I've got project in my school which is Access database. My teacher said that if she notice any signs of using someone's else project, then she will fail that person. I've used some parts...
6
by: HappyHippy | last post by:
More of a minor niggle than anything but how would I remove the aforementioned space? eg. strName = 'World' print 'Hello', strName, ', how are you today?' comes out as "Hello World , how are...
6
by: Nathan Sokalski | last post by:
I recently converted some ASP.NET 1.1 projects of mine, created with Visual Studio .NET 2003, to Web Application Projects in Visual Studio .NET 2005 so that I could use ASP.NET 2.0 (All my ASP.NET...
14
by: Russell Hoover | last post by:
I want "www." to never show in a browser's location bar when anyone visits my site via my domain-name. i.e. : BAD: http://www.my-domain-name GOOD: http://my-domain-name How can I...
3
by: Yobbo | last post by:
Hi All I have an ASP function in place to strip invalid chars out of a data store before I create an XML file of this data, but my function doesn't work on a certain set of chars. As far as I...
4
by: Ahmed, Shakir | last post by:
I have thousands of records in MS Access database table, which records I am fetching using python script. One of the columns having string like '8 58-2155-58' Desired output: '858215558' I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.