Sponsored Content
Top Forums Shell Programming and Scripting Append line count to each line Post 302432701 by jaysean on Saturday 26th of June 2010 12:17:52 AM
Old 06-26-2010
Sample input:

aaa bbb ccc
aaa bbb ccc
ddd eee fff
ddd eee fff

The output from my script will be:
2 aaa
2 ddd

I want the sum of occurrence of aaa and bbb =2+2 i.e. the line count to show up at the end of each line

i.e. output will be:

2 aaa 4
2 ddd 4
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Line Count and Append it to the end of the file.

Hi, I want to get a Line count of a file and append that at the end of the file. The Line count should not include the Headers : ------------------ COL1,COL2,COL3 123,abc,011 111,abd,0212 Record Count: 2 ------------------- Thanks. (7 Replies)
Discussion started by: smc3
7 Replies

2. Shell Programming and Scripting

Joining lines in reverse. append line 1 to line 2.

Hi I have used many times the various methods to append two lines together in a file. This time I want to append the 1st line to the second and repeat for the complete file.... an example This is the file owns the big brown dog joe owns the small black dog jim What I want is ... (7 Replies)
Discussion started by: dwalley
7 Replies

3. Shell Programming and Scripting

Append instance count to each line

Hello forum, I need help with a script for displaying the number of instances/times a particular line appears in a tab-delimited file and append that number to the end of the line. Example text file: aaa bbb ccc ddd ggg hhh kkk nnn aaa bbb ccc ddd aaa bbb ccc ddd ppp qqq nnn sss ggg... (1 Reply)
Discussion started by: jaysean
1 Replies

4. Shell Programming and Scripting

append delimeter count for each line in text file

Hi guys, plz tell me how to achieve this how to delete the lines in a file using sed command (6 Replies)
Discussion started by: hari908
6 Replies

5. Shell Programming and Scripting

Append next line to previous line when one pattern not found

Hi, I need help for below scenario.I have a flat file which is having records seperated by delimiters which will represent each record for oracle table.My Control file will consider each line as one record for that table. Some of the lines are aligned in two/three lines so that records are... (4 Replies)
Discussion started by: kannansr621
4 Replies

6. Shell Programming and Scripting

find a certain line and append text to the end of the line

After I create printer queues in AIX, I have to append a filter file location within that printers custom file. within lets say test_queue.txt I need to find the row that starts with :699 and then I need to append on the end the string /usr/local/bin/k_portrait.sh. Now I've gotten the sed... (2 Replies)
Discussion started by: peachclift
2 Replies

7. UNIX for Dummies Questions & Answers

How to remove fields space and append next line to previous line.?

awk 'BEGIN{FS = "Ç"} NR == 1 {p = $0; next} NF > 1 {print p; p = $0} NF <= 1 {p = (p " " $0)} END {print p}' input.txt > output.txt This is what the input data file looks like with broken lines Code: 29863 Ç890000000 Ç543209911 ÇCHNGOHG Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies

8. Shell Programming and Scripting

Append Next line with current Line bassed on condition

Hi, I have an XML file and I am tring to extract some data form it, after lot of data cleaning process, I ended up with an issue, and need your urgent support. my current input data in below format: <Node>xxxxxx <Node>yyyyy</Node> <Node>zzzzzz <Node>12345</node> I need... (9 Replies)
Discussion started by: rramkrishnas
9 Replies

9. Shell Programming and Scripting

Count the pipes "|" in line and delete line if count greter then number.

Hello, I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17". i.e need to get records having exact 17 pipe separated fields(no more or less) currently i have below : awk... (1 Reply)
Discussion started by: ketanraut
1 Replies

10. Shell Programming and Scripting

Remove new line starting with a numeric value and append it to the previous line

Hi, i have a file with multiple entries. After some tests with sed i managed to get the file output as follows: lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1, 00,2110597,2094790,0,81,529,75649011,56435363, lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 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 10:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy