Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-30-2009, 03:20 AM   #16
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,300

Rep: Reputation: 102Reputation: 102

Originally Posted by ghostdog74 View Post
If doing it in shell, here's one approach
while IFS="|" read a b c
    case "$a" in 
    ">"*  ) echo ">$c";;
    *) echo $a"|"$b"|"$c
done < "file"
instead of calling grep and awk for each line, you can use the shell's internal functions. much faster that way
Thanks Ghostdog for the tip. Could you please explain this code. Thanks !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sed, awk, Keep only text between two regular expressions scott_audio Linux - Newbie 9 08-06-2009 02:46 PM
sed - regular expression Vilmerok Programming 5 02-26-2009 08:44 AM
again stucked with text processing (sed/awk/perl), copy the line and change rahmathullakm Programming 4 01-19-2009 01:53 PM
sed regular expression Ammad Linux - General 7 10-29-2008 05:52 PM
bash/sed/awk fill each line in text file with space to fixed length khairil Programming 11 01-09-2008 05:28 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration