Find/Change long text


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find/Change long text
# 1  
Old 07-10-2006
Find/Change long text

If I have very large text file

***************
***************
***************
***************
***************
ABC-sdfsdf
BBB-xk[ptr';
CCC-sdfolb
ABC-dltg'fl;l

My aim:
-> tail last 10 lines from large text. ***** Ok *****
-> Change first 3 charactors which begin with "ABC" to "abc". ***** ??? ****
Thk very much
# 2  
Old 07-10-2006
Try this
Code:
tail -10 input_file | sed 's/^ABC/abc/' > output_file

Jean-Pierre.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Editing long text file

Good morning all, I have a machine running IRIX and I need to edit a text file on the terminal that is literally thousands of lines. Does anyone know the most efficient way to edit portions of files like these? Obviously simply using the vi command isn't going to work since I get a too many lines... (1 Reply)
Discussion started by: James C
1 Replies

2. Shell Programming and Scripting

Find command take too long

Hi, I use the below script that will find n record the entire directory structure for a given folder. bash-3.2$ more mkdir.sh find . -type d |while read rec do echo "mkdir $rec" echo "chmod -R 777 $rec" #done done >> moht.sh The problem is the folder i m running this script... (10 Replies)
Discussion started by: mohtashims
10 Replies

3. Shell Programming and Scripting

Find command takes long

Hi, I am trying to search for a Directory called "mont" under a directory path "/opt/app/var/dumps" Although "mont" is in the very parent directory called "dumps" i.e "/opt/app/var/dumps/mont" and it can never be inside any Sub-Directory of "dumps"; my below find command which also checks... (5 Replies)
Discussion started by: mohtashims
5 Replies

4. UNIX for Advanced & Expert Users

Find command takes too long to complete

Hi, Below is my find command find /opt/app/websphere -name myfolder -perm -600 | wc -l At time it even takes 20 mins to complete. my OS is : SunOS mypc 5.10 Generic_150400-09 sun4v sparc SUNW,T5440 (10 Replies)
Discussion started by: mohtashims
10 Replies

5. Shell Programming and Scripting

find only 6 char long

find /tmp -type f -mtime +180 I have this script get the list to clean up files older than 180 days under /tmp. But, I want to make sure to grep only a type of files, which have only 6 character long. .... LT3hqa dRMoya ... (16 Replies)
Discussion started by: Daniel Gate
16 Replies

6. Shell Programming and Scripting

find 3 character long text

I was trying to do some experiment with "sed". I want to find the filenames which are three characters. So, this is what I have done to search for it, using sed. sed -n -e '/^\{3\}$/p' test This returns the correct output for characters. But if I make change, let's say i create 2 more... (4 Replies)
Discussion started by: aksijain
4 Replies

7. Shell Programming and Scripting

sendmail long text

This is regarding sendmail. cat test.msg | sendmail -t In test msg I have the following. To: test@mymail.com Subject: Test Long text beings ... Now when I receive the email in Outlook I get an "!" inserted usually at position 990 and repeated mostly after every 990 chars or 65 chars.... (2 Replies)
Discussion started by: roadway
2 Replies

8. OS X (Apple)

Change Long User Name THrough The Terminal

Hello, I was wondering how to change a user's Long Name through the terminal. I am writing a shell script to change some settings back to the default, and could not find how to do this (or even if you can do this). I do not want to use applescript. (2 Replies)
Discussion started by: The Reepr
2 Replies

9. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

10. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies
Login or Register to Ask a Question