Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk command to paste 1st columns of 2 files. Post 303042861 by RudiC on Wednesday 8th of January 2020 04:31:31 PM
Old 01-08-2020
Can't reproduce your problem:
Code:
paste file[12]
2020-01-07 235400    ossuser
2020-01-07 235400    ossuser
2020-01-07 235401    ossuser
2020-01-07 235401    ossuser
2020-01-07 235401    ossuser
2020-01-07 235401    ossuser
2020-01-07 235401    ossuser
2020-01-07 235404    ossuser
2020-01-07 235404    ossuser
2020-01-07 235752    ossuser

but neither can produce your required output as no e.g. 2020-01-05 020012 is in your input data.
With strange problems like this, I usually presume non-printing control characters in file, like the DOS line terminator <CR> (\r = ^M = 0x0D).
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cut and paste columns using awk

Hi, Let's say that I have a file called table, I know that if I need to see a the second column for exampls I use: awk ' {print $2}' table.txt Is there anyway to use awk to actually cut a column and put it somewhere else in the table?:confused: (8 Replies)
Discussion started by: cosmologist
8 Replies

2. Shell Programming and Scripting

appending several columns with awk and paste

Hello, I am trying to solve for a couple of hours now the following problem: I have n files and would like to add the third column of each file to a new file: temp1.txt 1 2 3 1 2 3 1 2 3 temp2.txt 1 2 4 1 2 4 1 2 4 1 2 4 temp3.txt (2 Replies)
Discussion started by: creamcheese
2 Replies

3. Shell Programming and Scripting

awk command for simple join command but based on 2 columns

input1 a_a a/a 10 100 a1 a_a 20 200 b1 b_b 30 300 input2 a_a a/a xxx yyy a1 a1 lll ppp b1 b_b kkk ooo output a_a a/a 10 100 xxx yyy (2 Replies)
Discussion started by: ruby_sgp
2 Replies

4. Shell Programming and Scripting

Copy and Paste Columns in a Tab-Limited Text file

I have this text file with a very large number of columns (10,000+) and I want to move the first column to the position of the six column so that the text file looks like this: Before cutting and pasting ID Family Mother Father Trait Phenotype aaa bbb ... (5 Replies)
Discussion started by: evelibertine
5 Replies

5. Shell Programming and Scripting

Paste second columns from files to its corresponding file

Hi All, I have two sets of files. One set with extension .txt This set has file names with numbers like these. 1.txt, 2.txt, 3.txt until extactly 100.txt. The .txt files look like these: 0.38701788 93750 0.38622013 94456 0.38350296 94440 0.38282126 94057 0.38282126 94439 0.35847232... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

awk command to replace columns in 2 files

Hi All, I already have a code which replaces column 14 of NPBR.XTR.tmp with column 8 of NPBR3G.XTR.final awk -F'\|' 'FNR==NR{a= $2"^"$8;next;}a{split(a,b,"^");$8=b;$14=b;}1' OFS="|" ${SHTEMP}NPBR3G.XTR.final ${SHTEMP}NPBR.XTR.tmp > ${SHTEMP}NPBR.XTR.final I also need to replace column 15... (2 Replies)
Discussion started by: nua7
2 Replies

7. Shell Programming and Scripting

Character screening and paste into new file in columns instead of rows

QL10169_SAUJANA%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_KCRN11,MeContext=QL10169_SAUJANA_5 %External_Link_Failure %X2_link_problem_to_one_or_several_neighbouring_eNodeBs. QL10187_MATANG_JAYA_2%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_KUCHING,MeContext=QL10187_MATANG_JAY A_2_3... (2 Replies)
Discussion started by: Ankit Vyas
2 Replies

8. UNIX for Beginners Questions & Answers

Character screening and paste into newfile in columns instead of rows

QL10169_SAUJANA%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_KCRN11,MeContext=QL10169_SAUJANA_5 %External_Link_Failure %X2_link_problem_to_one_or_several_neighbouring_eNodeBs. QL10187_MATANG_JAYA_2%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_KUCHING,MeContext=QL10187_MATANG_JAYA_2_3... (2 Replies)
Discussion started by: Ankit Vyas
2 Replies

9. Shell Programming and Scripting

Paste columns based on common column: multiple files

Hi all, I've multiple files. In this case 5. Space separated columns. Each file has 12 columns. Each file has 300-400K lines. I want to get the output such that if a value in column 2 is present in all the files then get all the columns of that value and print it side by side. Desired output... (15 Replies)
Discussion started by: genome
15 Replies

10. UNIX for Beginners Questions & Answers

How to use "awk" to print columns from different files in separate columns?

Hi, I'm trying to copy and paste the sixth column from a bunch of files into a single file having each column pasted in separate columns (and not one after each other in just one column.) I tried this code but works only partially because it copied and pasted 50 rows of each column... (6 Replies)
Discussion started by: Frastra
6 Replies
ippool(4)							   File Formats 							 ippool(4)

NAME
ippool, ippool.conf - IP pool file format SYNOPSIS
ippool.conf DESCRIPTION
The format for files accepted by ippool(1M) is described by the following grammar: line ::= table | groupmap . table ::= "table" role tabletype . groupmap ::= "group-map" inout role number ipfgroup tabletype ::= ipftree | ipfhash . role ::= "role" "=" "ipf" . inout ::= "in" | "out" . ipftree ::= "type" "=" "tree" number "{" addrlist "}" . ipfhash ::= "type" "=" "hash" number hashopts "{" hashlist "}" . ipfgroup ::= setgroup hashopts "{" grouplist "}" | hashopts "{" setgrouplist "}" . setgroup ::= "group" "=" groupname . hashopts ::= size [ seed ] | seed . size ::= "size" "=" number . seed ::= "seed" "=" number . addrlist ::= range [ "," addrlist ] . grouplist ::= groupentry [ ";" grouplist ] | groupentry ";" | addrmask ";" | addrmask ";" [ grouplist ] . setgrouplist ::= groupentry ";" [ setgrouplist ] . groupentry ::= addrmask "," setgroup . range ::= addrmask | "!" addrmask . hashlist ::= hashentry ";" [ hashlist ] . hashentry ::= addrmask . addrmask ::= ipaddr | ipaddr "/" mask . mask ::= number | ipaddr . groupname ::= number | name . number ::= digit { digit } . ipaddr = host-num "." host-num "." host-num "." host-num . host-num = digit [ digit [ digit ] ] . digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" . name ::= letter { letter | digit } . The IP pool configuration file is used for defining a single object that contains a reference to multiple IP address/netmask pairs. A pool can consist of a mixture of netmask sizes, from 0 to 32. In the current release, only IPv4 addressing is supported in IP pools. The IP pool configuration file provides for defining two different mechanisms for improving speed in matching IP addresses with rules. The first, table, defines a lookup table to provide a single reference in a filter rule to multiple targets. The second mechanism, group-map, provides a mechanism to target multiple groups from a single filter line. The group-map command can be used only with filter rules that use the call command to invoke either fr_srcgrpmap or fr_dstgrpmap, to use the source or destination address, respectively, for determining which filter group to jump to next for continuation of filter packet pro- cessing. Pool Types Two storage formats are provided: hash tables and tree structure. The hash table is intended for use with objects that all contain the same netmask or a few, different sized-netmasks of non-overlapping address space. The tree is designed for supporting exceptions to a covering mask, in addition to normal searching as you would do with a table. It is not possible to use the tree data storage type with group-map configuration entries. Pool Roles When a pool is defined in the configuration file, it must have an associated role. At present the only supported role is ipf. Future devel- opment might see further expansion of the use of roles by other sections of IPFilter code. EXAMPLES
The following examples show how the pool configuration file is used with the ipf configuration file to enhance the succinctness of the lat- ter file's entries. Example 1: Referencing Specific Pool The following example shows how a filter rule makes reference to a specific pool for matching of the source address. pass in from pool/100 to any The following pool configuration matches IP addresses 1.1.1.1 and any in 2.2.0.0/16, except for those in 2.2.2.0/24. table role = ipf type = tree number = 100 { 1.1.1.1/32, 2.2.0.0/16, !2.2.2.0/24 }; Example 2: ipf Configuration Entry The following ipf.conf excerpt uses the fr_srcgrpmap/fr_dstgrpmap lookups to use the group-map facility to look up the next group to use for filter processing, providing the call filter rule is matched. call now fr_srcgrpmap/1010 in all call now fr_dstgrpmap/2010 out all pass in all group 1020 block in all group 1030 pass out all group 2020 block out all group 2040 An ippool configuration to work with the preceding ipf.conf segment might look like the following: group-map in role = ipf number = 1010 { 1.1.1.1/32, group = 1020; 3.3.0.0/16, group = 1030; }; group-map out role = ipf number = 2010 group = 2020 { 2.2.2.2/32; 4.4.0.0/16; 5.0.0.0/8, group = 2040; }; FILES
o /dev/ippool o /etc/ipf/ippool.conf o /etc/hosts ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWipfu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ipf(1M), ipnat(1M), ippool(1M), ipf(4), attributes(5), hosts(4) SunOS 5.10 30 Apr 2004 ippool(4)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy