Remove ascii code from a certain position in file
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Remove ascii code from a certain position in file




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Remove ascii code from a certain position in file  
John


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-03-04 12:50 PM

I'm very familiar with the tr command and use it a lot when removing
certain characters from files, but my situation today is involving
needing to remove a newline character from a certain area in the
file.... not all newline characters in the entire file.

If I had a 100 line file and wanted to state "ONLY Between lines 35
and 42, remove the newline character", how would I do that?  I'm
thinking this would involve sed, but am unsure about the setup.

Thanks.





[ Post a follow-up to this message ]



    Re: Remove ascii code from a certain position in file  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-03-04 10:52 PM

2004-09-3, 06:40(-07), John:
> I'm very familiar with the tr command and use it a lot when removing
> certain characters from files, but my situation today is involving
> needing to remove a newline character from a certain area in the
> file.... not all newline characters in the entire file.
>
> If I had a 100 line file and wanted to state "ONLY Between lines 35
> and 42, remove the newline character", how would I do that?  I'm
> thinking this would involve sed, but am unsure about the setup.

Please don't multi-post, your question was already answered in
comp.unix.questions

--
Stephane





[ Post a follow-up to this message ]



    Re: Remove ascii code from a certain position in file  
Michael Vilain


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-03-04 10:52 PM

In article <933293a5.0409030540.596094c1@posting.google.com>,
pokechoppe@aol.com (John) wrote:

> I'm very familiar with the tr command and use it a lot when removing
> certain characters from files, but my situation today is involving
> needing to remove a newline character from a certain area in the
> file.... not all newline characters in the entire file.
>
> If I had a 100 line file and wanted to state "ONLY Between lines 35
> and 42, remove the newline character", how would I do that?  I'm
> thinking this would involve sed, but am unsure about the setup.
>
> Thanks.

In case someone hasn't mentioned this in the other group you posted in
(cross-posting is encouraged in the unix groups), why not write a perl
or awk script to read lines and keep a count.  If the count is between
35 and 42, output the line without the trailing "\n" otherwise just
output the line.

just a SMOP (simple matter of programming)...

--
DeeDee, don't press that button!  DeeDee!  NO!  Dee...








[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:06 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register