SED taking too much time

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SED taking too much time
# 1  
Old 06-07-2011
SED taking too much time

I am trying to remove some characters from my data file.
The data file has huge number of records say 90000 records.
I am using sed for this purpose.
eg :
cat FILENAME|sed 's/;//g'

(to remove semi colon ';')

However as the data file is too huge , it is taking too much time to give result.
Any suggestion to improve the performance or alternate better way of doing it ?

Thanks in advance.

Last edited by pludi; 06-07-2011 at 08:47 AM..
# 2  
Old 06-07-2011
Try this, but i think there wont be much difference.

perl -i.bak -0pe 's/;//g' input

Last edited by getmmg; 06-07-2011 at 08:54 AM.. Reason: Added -i.bak
# 3  
Old 06-07-2011
You could also try:
tr -d ';' < file

awk -F; '$1=$1' OFS= file

# 4  
Old 06-07-2011
Few things u can avoid..not to use cat filename|and then doing search

Bit modified one...

sed '/;/s/;//g' filename

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Time taking for cfgmgr on dual VIO

Hi, From the man page, cfgmgr configures devices and optionally installs device software by running the programs specified in the Configuration Rules object class and it is not dependent on platform . Are there any fundamental differences impacting the speed of cfgmgr on a stand-alone and... (5 Replies)
Discussion started by: Sachin1987
5 Replies

2. Shell Programming and Scripting

Script taking more time in CRONTAB

Hello All, I have created a shell script, When i run it manually as ./<script_name> it takes 5 hours to run, but when i am scheduling it in crontab, it is taking 20 hours to run. Please help me and advice, what can be done to reduce the time in crontab. Thank you (6 Replies)
Discussion started by: anand2308
6 Replies

3. UNIX for Dummies Questions & Answers

ls is taking long time to list

Hi, All the data are kept on Netapp using NFS. some directories are so fast when doing ls but few of them are slow. After doing few times, it becomes fast. Then again after few minutes, it becomes slow again. Can you advise what's going on? This one directory I am very interested is giving... (3 Replies)
Discussion started by: samnyc
3 Replies

4. Debian

sendmail taking too much time to send a email

Hi , I'm using sendmail command to send a email. To send a email sendmail taking 3minutes to complete the process. Is there any configuration needs to be done in server or another solution is there to resolve this issue. Thanks in Advance. Regards Latika (1 Reply)
Discussion started by: latika
1 Replies

5. Shell Programming and Scripting

Taking one input at a time

Legends, Please help me to come out of the below Bermuda triangle. I have four inputs in a shell script: A B C D Now, If A is passed by user then, B C D will be ignored. If C is passed by user, then A B D will be ignored. Regards, Sandy (11 Replies)
Discussion started by: sdosanjh
11 Replies

6. UNIX for Advanced & Expert Users

command taking lot of time to execute

Hi, I am running the following command, and it tries to delete some dn from ldap, however, it takes lot of time before it finally request LDAP server to delete it. I am trying to find why it is taking lot of time. Could you anyone help me in this regard. I have copies the pstack output, and... (3 Replies)
Discussion started by: john_prince
3 Replies

7. UNIX for Dummies Questions & Answers

Job is taking long time

Hi , We have 20 jobs are scheduled. In that one of our job is taking long time ,it's not completing. If we are not terminating it's running infinity time actually the job completion time is 5 minutes. The job is deleting some records from the table and two insert statements and one select... (7 Replies)
Discussion started by: ajaykumarkona
7 Replies

8. Red Hat

login process taking a long time

I'm having a bit of a login performance issue.. wondering if anyone has any ideas where I might look. Here's the scenario... Linux Red Hat ES 4 update 5 regardless of where I login from (ssh or on the text console) after providing the password the system seems to pause for between 30... (4 Replies)
Discussion started by: retlaw
4 Replies

9. UNIX for Advanced & Expert Users

Truss taking time in stopping

Hi Experts, I am starting my unix servers with truss cmd and taking truss output in a file . But when I run it for considerabely long time, it is not stopping easily on doing ^C ..... It is taking lotz of ctrl-C's to stop. Please let me know is there any other way to stop truss except ^C and... (1 Reply)
Discussion started by: aarora_98
1 Replies
Login or Register to Ask a Question