10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have requirement to search for a text in the file and retrieve required lines that is user defined with unix command.
Eg:
Find the text UNIX in the below file and need to return Test 8 & Test 9
Test 1
Test 2
Test 3
Test 4
UNIX
Test 5
Test 6
Test 7
Test 8
Test 9
Result can... (8 Replies)
Discussion started by: Arunkumarsak4
8 Replies
2. Shell Programming and Scripting
I want to rearrange the fields of delimited text file after sorting first line (only):
input file:
a_13;a_2;a_1;a_10
13;2;1;10
the result should be:
a_1;a_2;a_10;a_13
1;2;10;13
any help would be appreciated
andy (20 Replies)
Discussion started by: andy2000
20 Replies
3. Shell Programming and Scripting
Hi,
I have a huge unsorted text file. We wanted to identify the unique field values in a line and consider those fields as a primary key for a table in upstream system.
Basically, the process or script should fetch the values from each line that are unique compared to the rest of the lines in... (13 Replies)
Discussion started by: manikandan23
13 Replies
4. Shell Programming and Scripting
I have the below contents in a file after making the below curl call
curl ... | grep -E "state|Rno" | paste -sd',\n' | grep "Disconnected" > test
"state" : "Disconnected",, "Rno" : "5554f1d2"
"state" : "Disconnected",, "Rno" : "10587563"
"state" : "Disconnected",, "Rno" :... (2 Replies)
Discussion started by: Vaibhav H
2 Replies
5. Shell Programming and Scripting
I have a file of ~500,000 entries in the following:
file.txt
chr1 11868 12227 ENSG00000223972.5 . + HAVANA exon . gene_id "ENSG00000223972.5"; transcript_id "ENST00000456328.2"; gene_type "transcribed_unprocessed_pseudogene"; gene_status "KNOWN"; gene_name "DDX11L1"; transcript_type... (17 Replies)
Discussion started by: cmccabe
17 Replies
6. Shell Programming and Scripting
Sample txt file :
OK00001111112|
OK00003443434|skjdaskldj
OK32812983918|asidisoado
OK00000000001|
ZM02910291029|sldkjaslkjdasldjk
what would be the shell script to figure out the blank space (if any) after the pipe sign? (4 Replies)
Discussion started by: chatwithsaurav
4 Replies
7. Shell Programming and Scripting
My data is something like shown below.
date1 date2 aaa bbbb ccccc
date3 date4 dddd eeeeeee ffffffffff ggggg hh
I want the output like this
date1date2 aaa eeeeee
I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies
8. Shell Programming and Scripting
i have this file which has the following contents:
,-0.3000 ,-0.3000 ,-0.3000
,-0.9000 ,-0.9000 ,-0.9000
i would like to get this:
-0.3-0.9-0.3-0.9-0.3-0.9
so far i am trying:
awk '{for(i=1; i<=NF; i++) {printf("%f\n",$i)}}' test1 > test2
any help... (4 Replies)
Discussion started by: npatwardhan
4 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I am new to unix scripting, please help me in solving this assignment..
I have a scenario, as follows:
1. i have a text file(read1.txt) with the following data
sairam,123
kamal,122
etc..
2. I have to write a unix... (6 Replies)
Discussion started by: G.K.K
6 Replies
10. Shell Programming and Scripting
Ive got a file called listacdrs with this structure:
01/09/2006 12:13 p.m. 1.046.528 CF0155.DAT
01/09/2006 12:13 p.m. 1.046.528 CF0156.DAT
01/09/2006 12:13 p.m. 1.046.528 CF0157.DAT
01/09/2006 12:13 p.m. 1.046.528 CF0158.DAT
01/09/2006 12:14 p.m. ... (3 Replies)
Discussion started by: alexcol
3 Replies
alarm_handler(3erl) Erlang Module Definition alarm_handler(3erl)
NAME
alarm_handler - An Alarm Handling Process
DESCRIPTION
The alarm handler process is a gen_event event manager process which receives alarms in the system. This process is not intended to be a
complete alarm handler. It defines a place to which alarms can be sent. One simple event handler is installed in the alarm handler at
start-up, but users are encouraged to write and install their own handlers.
The simple event handler sends all alarms as info reports to the error logger, and saves all of them in a list which can be passed to a
user defined event handler, which may be installed at a later stage. The list can grow large if many alarms are generated. So it is a good
reason to install a better user defined handler.
There are functions to set and clear alarms. The format of alarms are defined by the user. For example, an event handler for SNMP could be
defined, together with an alarm MIB.
The alarm handler is part of the SASL application.
When writing new event handlers for the alarm handler, the following events must be handled:
{set_alarm, {AlarmId, AlarmDescr}} :
This event is generated by alarm_handler:set_alarm({AlarmId, AlarmDecsr}) .
{clear_alarm, AlarmId} :
This event is generated by alarm_handler:clear_alarm(AlarmId) .
The default simple handler is called alarm_handler and it may be exchanged by calling gen_event:swap_handler/3 as gen_event:swap_han-
dler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args}) . NewHandler:init({Args, {alarm_handler, Alarms}}) is called. Refer to
gen_event(3erl) for further details.
EXPORTS
clear_alarm(AlarmId) -> void()
Types AlarmId = term()
Clears all alarms with id AlarmId .
get_alarms() -> [alarm()]
Returns a list of all active alarms. This function can only be used when the simple handler is installed.
set_alarm(alarm())
Types alarm() = {AlarmId, AlarmDescription}
AlarmId = term()
AlarmDescription = term()
Sets an alarm with id AlarmId . This id is used at a later stage when the alarm is cleared.
SEE ALSO
error_logger(3erl), gen_event(3erl)
Ericsson AB sasl 2.1.9.3 alarm_handler(3erl)