Ignore first word using sed in PERL


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ignore first word using sed in PERL
# 1  
Old 10-29-2010
Ignore first word using sed in PERL

Please help me in ignoring first word in a line example

Input log
Code:
123^Babd^Basdf789^B098^Bouiou

Desired output
Code:
abd,asdf789,098,ouiou

123 should be ignored

is this possible using sed regular expressions

Moderator's Comments:
Mod Comment Use code tags - you got a PM with a guide.

Last edited by zaxxon; 10-29-2010 at 05:57 AM..
# 2  
Old 10-29-2010
Hi,

This could work, althought the '^B' char misleads me:
Code:
sed 's/[^,]*,//' infile

Regards,
Birei
This User Gave Thanks to birei For This Post:
# 3  
Old 10-29-2010
Hey Thanks for the reply I really appriciate.

Also this is working
Code:
sed 's/^\([^^B]*\)//g' temp.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ignore dollar value in sed

Hi Guys, I need to replace the string based on specific value by keeping dollar sign input=$1 var=$(echo "@code_temp_table_$value_table"| sed -r "s/\@code/${input}/;s/(nz|sa)_\$value_/\$value1_\1_/" ) Expected if input=nz,sa then nz_temp_table_$value1_table else if any other... (5 Replies)
Discussion started by: Master_Mind
5 Replies

2. Shell Programming and Scripting

Replacing a particular word with another word in all the xml's under a particular directory with sed

Hi Folks, Could you please advise what will be the SED command to replace a word in all xml's under a particular directory for example let say I rite now at the following below location $ cd /ter/rap/config now under config directory there will be lots of xml file , now my objective is to... (1 Reply)
Discussion started by: punpun66
1 Replies

3. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

4. Shell Programming and Scripting

awk to ignore the text before a particular word

Hi I am new to Awk programming , i would appreciate if anyone help me with the below scenario i have text file arranged in rows and columns like below 11004 04493384 26798 CASSI0000I Server manager initialization started 111004 04493486 26798 CASSI4005I Retrieving ES... (7 Replies)
Discussion started by: rakeshkumar
7 Replies

5. Shell Programming and Scripting

extract whole thing in word, leaving behind last word. - perl

Hi, i've a string /u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD/TESi T_11_HD_120/hd-12 i need to get string, like /u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD the words from HD should get deleted, i need only a string till HD, i dont want to use any built in... (4 Replies)
Discussion started by: asak
4 Replies

6. Shell Programming and Scripting

regex - start with a word but ignore that word

Hi Guys. I guess I have a very basic query but stuck with it :( I have a file in which I want to extract particular content. The content is between standard format like : Verify stats A=0 B=12 C=34 TEST Failed Now I want to extract data between "Verify stats" & "TEST Failed" but do... (6 Replies)
Discussion started by: ratneshnagori
6 Replies

7. Shell Programming and Scripting

Getting the first word using sed,awk or perl

Input: root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4: tty:x:5: disk:x:6: lp:x:7: mail:x:8: Output: root daemon bin sys adm tty (8 Replies)
Discussion started by: cola
8 Replies

8. UNIX for Advanced & Expert Users

Script to ignore word from a line ...

Hi Gurus, I'm need of a script in which we are finding an independent word ‘boy' in a log file. We are using grep in order to do the same. Now in this log file there are some sentences where we see ‘This is a boy' and we do not want to count word ‘boy' from this sentence. So in other word we want... (2 Replies)
Discussion started by: heyitsmeok
2 Replies

9. Shell Programming and Scripting

perl (word by word check if a hash key)

Hi, Now i work in a code that 1-get data stored in the database in the form of hash table with a key field which is the " Name" 2-in the same time i open a txt file and loop through it word by word 3- which i have a problem in is that : I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies

10. Shell Programming and Scripting

Make sed ignore lines

Hi I use sed in a script for severall changes in files. I whish one of the substitutions I made to be aplied to every line that has the word "scripts" with the exception for the ones that start with "rsh", wich I wish sed to ignore . Is this possible? If yes, how can I do it? The substitution... (2 Replies)
Discussion started by: Scarlos
2 Replies
Login or Register to Ask a Question