Sponsored Content
Full Discussion: Print separated datas
Top Forums Shell Programming and Scripting Print separated datas Post 302426353 by ras on Tuesday 1st of June 2010 03:38:08 PM
Old 06-01-2010
Almost There

Hi danmero.

I think that I didn't explained correctly my question.
My english is poor then I think it's a problem.
If you can help me ,, it will be good.

I need to print all ASN that are about my responsability.

In this case ASN5 and ASN6 together so.


I m put this in variable , Im using it.

Code:
#FirstVariable=`egrep '5|6|' myfile  | awk '{print $3}' | sort | uniq `

11:35 10/12/2003 10.10.10.1 God.com 5 country Responsable of ASN
11:37 12/12/2003 10.10.10.1 FATHER.COM 5 country Responsable of ASN
11:40 14/12/2003 10.10.10.3 www.mother 6 country Responsable of ASN
11:45 14/12/2003 10.10.10.3 www.daugher 6 country Responsable of ASN

Now I need to get field "IP" inside the variable First .
Because I need to do "WHOIS" in each "IP"
Code:
#SecondVariable=10.10.10.1 and 10.10.10.10.3

After this I need to do command " WHOIS" , i have a script to do "WHOIS".
Then I think that could be make so.

Code:
#for I in `echo $IP`; do 
#	echo "  WHOIS  " > $EMAIL
#	$WHOIS $I >> $EMAIL
#	echo " -- " >> $EMAIL
#	echo "  " >> $EMAIL

When I do this "command for" i want to print my line(s) that are related with my ip , so.

First Time print this
Code:
#11:35 10/12/2003 10.10.10.1 God.com 5 country Responsable of ASN
#11:37 12/12/2003 10.10.10.1 FATHER.COM 5 country Responsable of ASN

And send e-mail .
I did it.

Second Time print this
Code:
11:40 14/12/2003 10.10.10.3 www.mother 6 country Responsable of ASN
11:45 14/12/2003 10.10.10.3 www.daugher 6 country Responsable of ASN

and send another e-mail.

Thanks a lot people

Moderator's Comments:
Mod Comment Please use code tags

Last edited by Scott; 06-01-2010 at 07:05 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Blank characters between Datas

Hello, I read a file whose in lines are datas and between thses datas there is blank characters (10, 12 or 5 or 1 .......) So when i use the command while read line in the script(see under) there is also only one character between the datas and the others blank characters are not here. ... (3 Replies)
Discussion started by: steiner
3 Replies

2. Shell Programming and Scripting

arranging datas if input file is not having also...!!

hi, my input file is containg uid, eriMaster ,eriResign, ericontry, dept. some of the uid are not having all info. out put should include all info irrespctive of datas of input file if any one data is missing, then it has to print Null or zero..then continue with the existing one. here... (0 Replies)
Discussion started by: hegdeshashi
0 Replies

3. Shell Programming and Scripting

Perl script to parse output and print it comma separated

I need to arrange output of SQL query into a comma separated format and I'm struggling with processing the output... The output is something like this: <Attribute1 name><x amount of white spaces><Atribute value> <Attribute2 name><x amount of white spaces><Atribute value> <Attribute3... (2 Replies)
Discussion started by: Juha
2 Replies

4. Shell Programming and Scripting

Compare Tab Separated Field with AWK to all and print lines of unique fields.

Hi. I have a tab separated file that has a couple nearly identical lines. When doing: sort file | uniq > file.new It passes through the nearly identical lines because, well, they still are unique. a) I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies

5. Shell Programming and Scripting

Grep and print next 10 Lines separated by ,

Hi All, I need to grep through a file for a string and print the next ten lines to a file separating the lines with a , and save it as a csv file to open it as a XL file. The 10 lines should be on a sigle row in xl. Any suggesstions please. Note; I dont have a GNU Grep to use -A flag. ... (6 Replies)
Discussion started by: Nani369
6 Replies

6. Shell Programming and Scripting

Print pipe separated list as line by line in Korn Shell

Korn Shell in AIX 6.1 I want to print the below shown pipe (|) separated list line by line. line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883 for i in line do echo "Hello $line " done I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies

7. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

8. Shell Programming and Scripting

awk print - fields separated with comma's need to ignore inbetween double quotes

I am trying to re-format a .csv file using awk. I have 6 fields in the .csv file. Some of the fields are enclosed in double quotes and contain comma's inside the quotes. awk is breaking this into multiple fields. Sample lines from the .csv file: Device Name,Personnel,Date,Solution... (1 Reply)
Discussion started by: jxrst
1 Replies

9. Linux

Print each ; separated value, in front of the value preceding them

I have a file that looks like this, P38112 Q12389; Q03532; P43586; Q08208; P37838; P40693; P38805 Q12389 P32892; P36049; Q03532; P43586; Q12176; P38112; P39744; P37838 P11154 P39940 P50094 P50095 P32892 Q12389; Q04660; P43586; P37838; P40693 Q05022 Q08235; Q12176; P39744 P40347 P32333... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies

10. Shell Programming and Scripting

Format column datas

I have some data like this: 4258092 TRXCODE a 19 CARDNBR a 10 PINFLAG a 6 FUISSUER a 12 PRODUCT a 24 STATE n 1 I want out put this format: <?xml version="1.0" encoding="GB2312"?> <convGrp> <grpid>4258092</grpid> <script> <!]> ... (4 Replies)
Discussion started by: hhdzhu
4 Replies
All times are GMT -4. The time now is 10:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy