Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search Pattern and add column Post 302385230 by harjitsingh on Thursday 7th of January 2010 12:05:51 PM
Old 01-07-2010
Search Pattern and add column

Hi,
I have two files. file1 contents:
Code:
aaa bbb ccc ddd
eee fff  ggg  ddd
www eee ggg dde
qqq zzz hhh ddd

file2 contents:
Code:
mmm
mmm
mmm
mmm

Now I want to add file2 contents to end of lines in file1 where a line contains pattern "ddd" and it should look like this:

file3 contents:
Code:
aaa bbb ccc ddd mmm
eee fff  ggg  ddd mmm
www eee ggg dde
qqq zzz hhh ddd mmm

Thanks,

Last edited by Yogesh Sawant; 02-26-2010 at 12:53 PM.. Reason: added code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search a pattern and if pattern found insert new pattern at the begining

I am trying to do some thing like this .. In a file , if pattern found insert new pattern at the begining of the line containing the pattern. example: in a file I have this. gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies

2. Shell Programming and Scripting

How to search pattern and add that pattern in next line

Hi All, I am new to shell scripting and need help in scripting using CSH. Here is what I am trying to so, 1. Search a specific string e.g. "task" from "task (input1, out1)". 2. Extract the arguements "input1" and "out1" 3. Add them in separate lines below. eg. "int input1" , " integer out1" ... (7 Replies)
Discussion started by: deshiashish
7 Replies

3. Shell Programming and Scripting

Search a pattern and add new line below

Hi, I have 2 files like below. File A: apple mango File B: start abc def apple ghi end start cba fed (4 Replies)
Discussion started by: jayadanabalan
4 Replies

4. UNIX for Dummies Questions & Answers

Search and add the column in the file

Hi All, I have the Overview.csv file like below format Message ID Sendout Group Name Email Subject Name Type Rcpts Responses Response Rate Open Rate Click Rate 2000009723 01-22-2014 16:14 Test_GroupPQA2013 000123@yahoo.com INFO RISQUE D'INONDATION... (3 Replies)
Discussion started by: armsaran
3 Replies

5. Shell Programming and Scripting

[awk] add column between range pattern

Hi all, I have table like this A1 1 2 1 3 2 4 A2 3 1 1 2 1 1 A3 1 1 2 0 3 2 ..... An And i want to add column to my table and the table will become like this : (3 Replies)
Discussion started by: psychop13
3 Replies

6. Shell Programming and Scripting

awk search pattern in column

Want to search a pattern in column using the below command which not helpful awk -F"\|" '$1 == '"${VAR}"' {print $1,$2}' file how to search using "==" with variable other than the below case. awk -F"\|" '$1 ~ /'"${VAR}"'/ {print $1,$2}' file (14 Replies)
Discussion started by: Roozo
14 Replies

7. Shell Programming and Scripting

Search Pattern and Print lines in Single Column

Hi Experts I have small query where I request the into a single file Suppose: File1: {Unique entries} AA BB CC DD FileB: AA, 123 AA, 234 AA, 2345 CC, 123 CC, 5678 DD,123 BB, 7890 (5 Replies)
Discussion started by: navkanwal
5 Replies

8. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies

9. UNIX for Beginners Questions & Answers

If pattern in column 3 matches pattern in column 2 (any row), print value in column 1

Hi all, I have searched and searched, but I have not found a solution that quite fits what I am trying to do. I have a long list of data in three columns. Below is a sample: 1,10,8 2,12,10 3,13,12 4,14,14 5,15,16 6,16,18 Please use code tags What I need to do is as follows: If a... (4 Replies)
Discussion started by: bleedingturnip
4 Replies

10. Shell Programming and Scripting

Script to find string based on pattern and search for its corresponding rows in column

Experts, Need your support for this awk script. we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file Need to grep row whose string contains 9K from column 1. When found... (6 Replies)
Discussion started by: as7951
6 Replies
APRSMON(8)						     Linux Programmer's Manual							APRSMON(8)

NAME
aprsmon - monitor APRS AX.25 traffic for javAPRS SYNOPSIS
aprsmon [-a] [-m] [-r] [-k minutes] [-p port] [-t title] [-i infofile] DESCRIPTION
Aprsmon uses SOCK_PACKET facilities to provide a network monitor of all AX.25 UI text traffic heard by the system. It is based on lis- ten(1). Aprsmon collects (-m) or displays standard AX.25 UI text frames in a format similar to that output by a standard TNC in "Monitor ON" mode and is intended to be used with programs like javAPRS which wish to see a TNC data stream over a TCP connection. When the aprsmon master has been running for a while and a new aprsmon slave starts up, first all saved up reports are sent, then a title line indicating the beginning of live data is sent, and new reports are sent as received. Compressed position and telemetry reports as generated by the APRS Mic Encoder are translated into the conventional uncompressed APRS Micro-Interface-Module (MIM) telemtry format so that these stations are visible in javAPRS. Reports containing a TheNet X1J4 beacon header are also edited to strip off the header making these nodes visible in javAPRS as well. OPTIONS
-a Allow for the monitoring of outgoing frames as well as incoming ones. -r Choose "raw" mode which allows non-printable data through. -p port Monitor only those frames received on a particular port, by default all AX.25 interfaces are monitored. -m "Master" mode. Retain monitored data for the number of minutes specified with the -k option in a shared memory segment. -k minutes Retain monitored packets going back the given number of minutes. Default is 30. -t title Sets the javAPRS title string. Default is "Live data from Linux." -i infofile Infofile is the path to the file that the aprsmon master writes the shared memory segment and semaphore id's into. Default is "/var/ax25/aprsmon.info." javAPRS CONFIGURATION Set up one aprsmon master running on your system to collect historical data going back a while. You will probably want to set up an /etc/rc.d/init.d script for this. aprsmon -a -m& Add an entry into /etc/services with the port number you want javAPRS to connect on. For example: aprs 14439/tcp # APRS monitor on 144.39 Add an entry into /etc/inetd.conf for this service: aprs stream tcp nowait root /usr/sbin/aprsmon aprsmon -a To test, simply "telnet localhost aprs". To use with javAPRS, set, for example, <PARAM name = "dataFile1" value = "netc:14439:localhost"> in your HTML file as described in the javAPRS documentation, and then use appletviewer to run javAPRS: appletviewer mydemo.html Mic-E to MIM Translation The Mic-E reduces the duration of packet noise on a voice frequency by encoding its data in a compressed form, some of which is binary. Some APRS-decoding software, notably javAPRS, is unable to deal with this data. To solve this problem aprsmon expands the Mic-E packet into one or two MIM packets as follows: @ddhhmmzDDMM.hhN/DDDMM.hhW$cse/spd/E>mon/Mm/status T#MIC,aaabbbcccdddeeefffComments ddhhmm is the UTC day and time the packet was received by the host running aprsmon. DDMM.hhN is the latitude. / is the symbol table selection (/ or ). DDDMM.hhW is the longitude. $ is the symbol. cse,spd are course and speed. E is the type of Mic-Encoder: E - TAPR Mic-Encoder T - Kenwood TH-D7 m is the status message number, and status is the status message number expanded as follows: 0 - Off duty.. 1 - Enroute... 2 - In Service 3 - Returning. 4 - Committed. 5 - Special... 6 - PRIORITY.. 7 - EMERGENCY. aaa,bbb,ccc,ddd,eee,fff are the values of the telemetry channels. FILES
/etc/ax25/axports /var/ax25/aprsmon.info SEE ALSO
call(1), listen(1), beacon(1), ax25(4), axattach(8), http://www.bridge.net/~sdimse/javAPRS.html, http://www.tapr.org, http://www.aprs.net, MIC-E.TXT,TELEMTRY.TXT,PROTOCOL.TXT AUTHOR
Alan Crosswell, n2ygk@weca.org Linux 9 February 1999 APRSMON(8)
All times are GMT -4. The time now is 06:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy