10-22-2006
concat fields
hi
I have a file, I need to concatenate depening on the no of columns i need to concatenate.
for example i need to concatenate field1,filed34,field2( no of columns is not always 3, it can be any number of fields)
concat.ksh field1 field34 field2
how to achieve this, is there any argv ,argc equivalent in ksh.
Hope i am clear
Mark.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How do I concat a date to a filename
eg;
filename: jjjrtup
to become
jjjrtup29052002
mv jjjrtup jjjrtup ? date
what should ? be (2 Replies)
Discussion started by: drukkie
2 Replies
2. Shell Programming and Scripting
HI all,
How to concat two strings in Shell scrpits
suppose
x=a
y=b
i want to display it as
ab
How to do it ?
Thanks.. (1 Reply)
Discussion started by: dhananjaysk
1 Replies
3. Shell Programming and Scripting
hey,
I want to concat whole bunch of strings together but somehow they don't turn out the way I want them to
a="HELLO "
b="WORLD "
c=$a$b
I was expecting c to be "HELLO WORLD " but it... (1 Reply)
Discussion started by: mpang_
1 Replies
4. Shell Programming and Scripting
Hello,
I have a list of tablespaces in oracle and I want to concatenate 'drop tablespace' on the left of each line and 'INCLUDING CONTENTS AND DATAFILES' on the right of each line.
Any idea how to do that?
many thanks.
PS: I tried to use excel and copy/paste it to vi. But I noticed many... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
5. Shell Programming and Scripting
Hello Unix gurus,
how to concat 3 files content side by side .
i have 3 files
more report1.txt
select *from tab1 A JOIN tab1 B ON
more report2.txt
A.PK1=B.PK1 where
more report3.txt
A.AAA <> B.AAA or
A.BBB <> B.BBB or
A.CCC<> B.CCCC or
..
..
..
A.ZZZ <> B.ZZZ;
if i concatinate... (3 Replies)
Discussion started by: kanakaraju
3 Replies
6. Shell Programming and Scripting
Hello,
I have a file with two fields in the following format..
NewYork|Rob
Boston|Mellisa
NewYork|Kevin
Boston|John
Chicago|Mike
Boston|Tom
My output should be:
NewYork|Rob,Kevin
Boston|Mellisa,John,Tom
Chicago|Mike
Basically I need to rollup on column A and stringconcat column... (5 Replies)
Discussion started by: bperl
5 Replies
7. Shell Programming and Scripting
Hi All,
My Input file contains:
Input.txt
Name|Marks
ABC|10
GHI|10
JKL|20
MNO|20
PQR|30
Output.txt
MARKS|NAME
10|ABC,GHI
20|JKL,MNO
30|PQR
Thanks in advance (4 Replies)
Discussion started by: kmsekhar
4 Replies
8. Shell Programming and Scripting
Hi Folks
The below is code is giving me value 30.
cal | sed '/^$/d' | tail -1 | awk '{printf $NF-1}'
Actually the text is like below.
echo "you should reply on 30-Jan-2013 evening EST.
Here how should i con-cat above logic in that text? (1 Reply)
Discussion started by: coolboy98699
1 Replies
9. Shell Programming and Scripting
Hello All,
I have a file with following data.
1365787116 3.0 contracts/Procs_Val_Req_forContrct_Amnd_BPEL
1348791394 2.0 contracts/Procs_Val_toTerm_Ret_Contrct_BPEL
1348791394 2.0 contracts/Qualfy_BP_forNew_Ret_Contrct_BPEL
1348791394 2.0 ... (8 Replies)
Discussion started by: Vikram_Tanwar12
8 Replies
10. Shell Programming and Scripting
Hi,
I need help to combine the first 7 character of firstname if it is longer than 7and combine with the first character of lastname.
ex: username lastname => usernaml
user lastname => userl
Thanks in advance. (10 Replies)
Discussion started by: xitrum
10 Replies
LEARN ABOUT DEBIAN
sniffit
SNIFFIT(5) File Formats Manual SNIFFIT(5)
NAME
sniffit - configuration file for sniffit (name arbirtary)
DESCRIPTION
This page describes the format for the config file for sniffit (see sniffit(8) ). This file allows you to specify in great detail witch
packets should be processed by sniffit. This file also controls (or will control) some functions for the continuous logging ('-L' option).
A sniffit config file might look like (Be sure to end it with a BLANK line):
# Sniffit Sample Config file -- Brecht Claerhout
logfile /var/log/sniffit.today.log
# First select all packets!
select both mhosts 1
select both mhosts 2
# Now deselect all packets from/to those damn 'surfers'
deselect both port 80
deselect both port 8001
This file will tell sniffit to process all packets on the subnet except those FROM/TO ports 80 and 8001 (thus we don't want logs of those
mass WWW connections witch turn our logs unreadable).
GLOBAL FORMAT
The file consists of lines, lines are formed by fields, fields are separated with SPACES (NO TABS). Unix comment lines (starting with '#'
are allowed). So this gives us:
<field1> <field2> <field3> <field4> <field5>
FIELD FORMAT
<field1>
select - Sniffit will look for packets that match the following description (other fields)
deselect - Sniffit will ignore packets that match the description
logfile - change the logfile name to <field2> instead of the default 'sniffit.log'
<field2>
from - Packets FROM the host matching the following desc. are considered.
to - similar, Packets TO the....
both - similar, Packets FROM or TO the....
a filename - as an argument of 'logfile' in <field1>
<field3>
host - The (de)selection criteria involves a hostname.
port - similar, ... a portnumber
mhosts - The (de)selection criteria involves multiple-hosts, like with the wildcars in 0.3.0, but without the 'x'
<field4>
Either a hostname, a portnumber, a service name or a numbet-dot partial notation indicating multiple hosts depending on <field3>
(service names like 'ftp' are resolved as the services available present on the host that runs Sniffit, and translated into a port
nr)
<field5>
A portnumber, if <field3> was 'host' or 'mhosts' (optional, if not filled in, all ports are going to be (de)selected)
FILE INTERPRETING
The config file is interpreted SEQUENTIAL, so watch it, don't mix lines in a file. Example:
select both mhosts 100.100.12.
deselect both port 80
select both host 100.100.12.2
This file will get you the packets:
a) Send by hosts '100.100.12.*'
b) EXCEPT the WWW packets
c) BUT showing the WWW packets concerning
100.100.12.2
select both mhosts 100.100.12.
select both host 100.100.12.2
deselect both port 80
Will give you the packets (probably unwanted result):
a) Send by hosts '100.100.12.*'
b) Send from/to 100.100.12.2 (useless line)
c) deselecting all WWW packets on the subnet
AUTHOR
Brecht Claerhout <coder@reptile.rug.ac.be>
SEE ALSO
sniffit(8)
SNIFFIT(5)