Sponsored Content
Full Discussion: Print separated datas
Top Forums Shell Programming and Scripting Print separated datas Post 302425804 by ras on Sunday 30th of May 2010 10:57:29 AM
Old 05-30-2010
Print separated datas

Hi People !!

I need your help.

I have a a txt file "example" with it datas.

Code:
[Hour]  [Data]   [IP]   [URL]  [ASN]  [Country] [Domain ASN Responsable]

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
12:50 18/12/2003  100.100.10.1  son.com  8  country   Responsable of ASN
12:55 18/12/2003  100.100.10.1   Cousin Corporation of America  8  country   Responsable of ASN

I want to print just ASN that are about my responsibility, this example only that with ASN , 5 and 6.

Example: I am using this command
Code:
egrep '5|6' example

This is a output of my command.
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
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

But I wanted that my output wil be this:
Code:
ASN5=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

ASN6=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

Because after i wil need to send e-mail to ASN5 and ASN6 separated.

Thanks all

Last edited by Scott; 06-01-2010 at 07:02 PM.. Reason: Please use code tags
 

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 05:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy