help needed urgently


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help needed urgently
# 8  
Old 02-08-2008
Code:
sed -e '/A0628/s/^/\n/g' sort.txt | sed '/./{H;d;};x;s/\n/={NL}=/g' | sort -n | sed '1s/={NL}=//;s/={NL}=/\n/g'

works

where sort.txt ist your input file

use sort -rn for reverse order

most is from
http://sed.sourceforge.net/sed1line.txt

very nice for beginners




cheers

funksen
# 9  
Old 02-08-2008
Question extract string components from a file by BASH script

thanx Funksen
but will u kindly explain the code u sent in my favor

Code:
sed -e '/A0628/s/^/\n/g' sort.txt | sed '/./{H;d;};x;s/\n/={NL}=/g' | sort -n | sed '1s/={NL}=//;s/={NL}=/\n/g'

because i am very much new in shell scripting and i know nothing about 'sed'
will it extract strings following ! , !! and !!!
waiting
# 10  
Old 02-08-2008
Question waiting any one to guide me

by the last post i got no reply and understanding of the code

Code:
sed -e '/A0628/s/^/\n/g' sort.txt | sed '/./{H;d;};x;s/\n/={NL}=/g' | sort -n | sed '1s/={NL}=//;s/={NL}=/\n/g'

plz anyone can tel me what does this code do regarding my problem , i told in detail above threads

thanx
# 11  
Old 02-09-2008
Question

i tried the code below

Code:
sed -e '/A0628/s/^/\n/g' sort.txt | sed '/./{H;d;};x;s/\n/={NL}=/g' | sort -n | sed '1s/={NL}=//;s/={NL}=/\n/g'

but i got the error msg again an again that

char 12 : unterminated `s'

itried to remove the error at my level best but plz i need guidence coz im quite a beginer in bash scripting
# 12  
Old 02-11-2008
statement works on fedora 8 and rhel4, but not on AIX, Solaris 10 or HPUX 11 in default configuration
problem is sed with \n

which os and shell have you got, I have allmost everything here to test
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need answers urgently!!

hello guys!! need 1 favour from u all.. Can u jst tell me the answers for these ques?? 1. ls - l _____ : command to return all files that end with single digit and those with TXT extension 2. ls -l report* _______ : command to return all files that start with the word RPT except those with LOG... (1 Reply)
Discussion started by: Gan_7
1 Replies

2. Shell Programming and Scripting

Help needed urgently. Look back for files in PERL

I have 3 variables $file =abc_2011_11_01.txt (current day file) $back = Yes $forward = No I need to search for 3 days back files / 3 days forward files if my current file is not present logic is, I need to download the current day file. If it is missing, i need to look out for... (1 Reply)
Discussion started by: irudayaraj
1 Replies

3. UNIX for Advanced & Expert Users

Please correct my script - Needed very urgently

hello all, I have a script, used to search for the strings from the set of 5 similar pattern file from the log dir. So here it goes . The input parameter is a part of the file name. When during the script execution, the script should parse the input parameter to original file's with the same... (1 Reply)
Discussion started by: raghunsi
1 Replies

4. Shell Programming and Scripting

Help need urgently....

I am new to shell scripting I am getting file sample.txt from mainframes to my unix machine Mon-Fri every 15 minutes from 9:00AM to 6:00PM. I need to Compare timestamp of sample.txt against system time via a Unix script kicked off by an Autosys job My Task is to write a shell script to monitor... (3 Replies)
Discussion started by: chinniforu2003
3 Replies

5. UNIX for Advanced & Expert Users

Help needed Urgently... Thanks in advance

You have a file called /opt/test/input.txt with the following information: man_aa_bld_100.410.040_CMD 08/14/2008 23:29:21 08/14/2008 23:31:10 SU 5339491/1 man_aa_bld_100.410.050_CMD 08/14/2008 23:29:21 08/14/2008 23:31:11 SU 5339491/1 man_aa_bld_100.410.060_CMD 08/14/2008 ... (3 Replies)
Discussion started by: jkumsi
3 Replies

6. Solaris

most urgently about pc-routing

Hi I have knowledge is a little about Solaris 10. I have problem route Question I have two lan interfaces nge0 >> 192.168.1.1 / 24 and link up Client1 >> 192.168.1.10 not out internet (GW 192.168.1.254) nge1 >> 192.168.50.220 /24 and link up Client50 >> 192.168.50.1 can... (2 Replies)
Discussion started by: sermsuk
2 Replies

7. UNIX for Dummies Questions & Answers

Help NEEDED urgently on exceutable file

Hi , i amtrying to execute a file called bcs_maint which is the final executable for our project. Normally on some other servers ican execute it by just typing bcs_maint. yesterday i got a new worksattion for me and when i do the same it says /sbin/sh: bcs_maint : not found. What... (5 Replies)
Discussion started by: jagan_kalluri
5 Replies

8. Shell Programming and Scripting

Need help urgently

Hi to All, I m a regular visitor of this site but this one is my first thread . Although I ve tried but I cant find the solution .:confused: I ve number of files having extension .file., which having some define statement in it.The files consits as follows Ex:- abc.file `define ADCONV0 ... (3 Replies)
Discussion started by: user_prady
3 Replies

9. UNIX for Dummies Questions & Answers

Major Help Urgently Needed!!!!

Right deleted Linux partition usig windows then went to format c:\ but had to exit window now pc ONLY boots into GNU Grub. Does anyone know how to format the hard drive now????? (3 Replies)
Discussion started by: billett05
3 Replies

10. Shell Programming and Scripting

Shell Script needed urgently

Hi Frends, I am need of a small shell script. Kindly any body help me by giving me a small shell script to read first line in a file and extract date from the first line and store it in a variable... and after storing it in a variable the first and the last line of the file has to be deleted..... (2 Replies)
Discussion started by: vas_dba
2 Replies
Login or Register to Ask a Question