Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > deleting data from text files

Reply
Thread Tools

deleting data from text files

 
 
Cancerbero
Guest
Posts: n/a
 
      08-07-2004
Hi.

I want to delete some chars from a text file. I would like to
know if this can be done with some "magic" function (for Linux)
and not rewriting the entire file without the imvolved chars.

Thanks

--
Sebastián Gurin (Cancerbero)
cancerbero_sgx AT users.sourceforge.net

 
Reply With Quote
 
 
 
 
SM Ryan
Guest
Posts: n/a
 
      08-08-2004
Cancerbero <(E-Mail Removed)> wrote:
# Hi.
#
# I want to delete some chars from a text file. I would like to
# know if this can be done with some "magic" function (for Linux)
# and not rewriting the entire file without the imvolved chars.

On most systems, the magic doesn't exist. Usually you have to shift the
bytes around yourself. Some systems do do this, but not many.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
I love the smell of commerce in the morning.
 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      08-08-2004
Cancerbero wrote:
>
> I want to delete some chars from a text file. I would like to
> know if this can be done with some "magic" function (for Linux)
> and not rewriting the entire file without the imvolved chars.


No.

--
Chuck F ((E-Mail Removed)) ((E-Mail Removed))
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


 
Reply With Quote
 
Martin Ambuhl
Guest
Posts: n/a
 
      08-08-2004
Cancerbero wrote:
> Hi.
>
> I want to delete some chars from a text file. I would like to
> know if this can be done with some "magic" function (for Linux)
> and not rewriting the entire file without the imvolved chars.


1. Short Answer: No
2. Longer Answer: Linux-specific functions are off-topic here. The
general C answer is covered in the FAQ, which you should have checked
before posting.
 
Reply With Quote
 
Cedric LEMAIRE
Guest
Posts: n/a
 
      08-09-2004
If you don't have to integrate this converter into a C program, you
can use CodeWorker (http://www.codeworker.org) and the following BNF
script, called "cancerbero.cwp":

#implicitCopy // What You Parse Is What You Write
transform ::=
// while it remains a char to ignore, jump to the following
[
// jump to the following char to ignore
->[
#explicitCopy // don't copy what will be parsed just below
// recognize a char amongst those to ignore
#readChar:{"<char1>", "<char2>", ... "<charn>"}
]
]*
->#empty // jump to the end of the file
;

Then, type:
codeworker -translate cancerbero.cwp <your-input-file>
<your-resulting-file>

Cancerbero <(E-Mail Removed)> wrote in message news:<pan.2004.08.05.13.22.05.805653.4026@montevid eo.com.uy>...
> I want to delete some chars from a text file. I would like to
> know if this can be done with some "magic" function (for Linux)
> and not rewriting the entire file without the imvolved chars.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting data from the file without deleting the file first crea C++ 2 12-28-2012 11:50 PM
Deleting a File from Hardrive and Deleting a SubKey in Registry Harry Barker C++ 2 04-19-2006 09:34 AM
how i can extract text from the PDF files,power point files,Ms word files? crazyprakash Java 4 10-30-2005 10:17 AM
Text files read multiple files into single file, and then recreate the multiple files googlinggoogler@hotmail.com Python 4 02-13-2005 05:44 PM
deleting data from a text file Shaf Perl Misc 5 10-12-2004 02:17 AM



Advertisments