nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Modify Text in a file

This is a discussion on Modify Text in a file within the Shell scripting forums, part of the Development/Scripting category; I have a file that in which email messages are stored in and every email is separated by by a ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 23-10-2008, 03:19 AM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
maxcell is on a distinguished road
Default Modify Text in a file

I have a file that in which email messages are stored in and every email is separated by by a ^Z character (Control-Z).

I need to delete all emails after the 65,00th one.

Any suggests on accomplishing this?
Reply With Quote
  #2 (permalink)  
Old 24-10-2008, 08:51 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,707
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by maxcell View Post
I need to delete all emails after the 65,00th one.
Is is 6,500 or only 65?
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 24-10-2008, 08:55 PM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
maxcell is on a distinguished road
Default

Actually its after the 65,000th one.

-Max
Reply With Quote
  #4 (permalink)  
Old 25-10-2008, 08:33 PM
permalac's Avatar
Member
User
 
Join Date: May 2008
Location: barcelona
OS: debian,opensuse,opensolaris,centos,fedora,backtrack
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
permalac is on a distinguished road
Default

sorry, I think i missundertood the question.

anyway, i was thinking with sed and awk.

Last edited by permalac; 25-10-2008 at 08:36 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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
To find and replace in text file nashtech Shell scripting 5 31-01-2010 06:32 AM
add - delete - alter - modify user through php ayush1440 Web servers 5 25-09-2008 09:19 AM
Cups is not printing text file with proper format, staircasing issue Ashish Pathak CentOS / RHEL / Fedora 1 18-11-2007 08:12 AM
rearranging columns in a text file sureshbup Shell scripting 2 06-12-2006 09:43 AM
Replacing text in a file using awk postyrus Shell scripting 4 02-05-2005 03:31 PM


All times are GMT +5.5. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38