Sponsored Content
Top Forums Shell Programming and Scripting Help with extracting a part of a line between two patterns Post 302624519 by itkamaraj on Monday 16th of April 2012 11:28:11 AM
Old 04-16-2012
just source it.
Code:
$ cat var.txt
message1="Reason for error code1"
message2="Reason for error code2"
message3="Reason for error code3.
                    To solve this, you may try doing restart"

#Source the file var.txt
$ . var.txt 

$ echo $message1
Reason for error code1

$ echo $message2 
Reason for error code2

$ echo $message3
Reason for error code3. To solve this, you may try doing restart

This User Gave Thanks to itkamaraj For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting part of a string

Hi all, I have to extract only the second part of a database column (VARCHAR) and the value is seperated by a "~" xyz~ chxyz36r~ abder~000082685 mnops~000083554 fulfil302~00026 Above are some examples of the values and for each record I have to extract the value after "~" , if there is a... (8 Replies)
Discussion started by: sam_78_nyc
8 Replies

2. Shell Programming and Scripting

need help extracting this part

JADE TRADER 143W MYPEN 40 HC M X10 28 7 1 0 MYPEN 20 GP X X10 15 2 1 0 MYPEN 40 GP X X10 28 7 1 0 MYPEN 20... (6 Replies)
Discussion started by: finalight
6 Replies

3. Shell Programming and Scripting

Extracting part of line between two words

Hi, I have a file few hundred MB's with text like one below in single line. 20091117 abc xyg 20091117 def ghi 20091118 ppp ttt 20091118 zzz zzz xxx I need to extract part of line from 1st occurence of pattern 20091117 till first occurence of another pattern 20091118. I tried... (3 Replies)
Discussion started by: artistic94555
3 Replies

4. UNIX for Dummies Questions & Answers

Locating and Extracting Specific Patterns from a file

Hi all, 1. I have a file that is getting continously refreshed (appended) I want to grep all the strings containing substring of the type abcdf123@aaa.xxx.yyy.zzz:portnumber: where, before @, any letters or numbers combination, after @, IP address then symbol : then port... (4 Replies)
Discussion started by: kokoras
4 Replies

5. Shell Programming and Scripting

Extracting text between two patterns 1 and 2 and pattern2 should be second occurrence of the file

Hi All, I have a small query. I have a file containing the following lines File 1: 29-Jul-2011 GMT Static data requires update <Extraction should start here> ----------- ----------- -------------------- ----------------------- ----------- <should stop here> Pattern1 will be time... (2 Replies)
Discussion started by: gangii87
2 Replies

6. Shell Programming and Scripting

extracting part of a line excluding particular word from it

here is the line on which i want to process `empNo` int(13) NOT NULL AUTO_INCREMENT, it sometimes doesnt have comma at the end too `empNo` int(13) NOT NULL AUTO_INCREMENT i want to extract all except "AUTO_INCREMENT" not only this line i ,want the code to work on any line if it has... (5 Replies)
Discussion started by: vivek d r
5 Replies

7. Shell Programming and Scripting

Extracting a set of patterns from the text file

Hi experts, I need a help in extracting a set of patterns from the text file. Below is my scenario. Input file: I need to extract the data between My output should be as Thanks, Kalai (7 Replies)
Discussion started by: kalpeer
7 Replies

8. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

9. Shell Programming and Scripting

Find matched patterns and print them with other patterns not the whole line

Hi, I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Discussion started by: redse171
3 Replies
asn1rt(3erl)						     Erlang Module Definition						      asn1rt(3erl)

NAME
asn1rt - ASN.1 runtime support functions DESCRIPTION
This module is the interface module for the ASN.1 runtime support functions. To encode and decode ASN.1 types in runtime the functions in this module should be used. EXPORTS
start() -> ok |{error,Reason} Types Reason = term() Starts the asn1 server that loads the drivers. The server schedules a driver that is not blocked by another caller. The driver is used by the asn1 application if specs are com- piled with options [per_bin, optimize] or [ber_bin, optimize, driver] . The server will be started automatically at encode/decode if it isn't done explicitly. If encode/decode with driver is used in test or industrial code it is a performance gain to start it explicitly to avoid the one time load in run-time. stop() -> ok |{error,Reason} Types Reason = term() Stops the asn1 server and unloads the drivers. decode(Module,Type,Bytes) -> {ok,Value}|{error,Reason} Types Module = Type = atom() Value = Reason = term() Bytes = binary | [Int] when integer(Int), Int >= 0, Int =< 255 | binary Decodes Type from Module from the list of bytes or binary Bytes . If the module is compiled with ber_bin or per_bin option Bytes must be a binary. Returns {ok,Value} if successful. encode(Module,Type,Value)-> {ok,BinOrList} | {error,Reason} Types Module = Type = atom() Value = term() BinOrList = Bytes | binary() Bytes = [Int|binary|Bytes] when integer(Int), Int >= 0, Int =< 255 Reason = term() Encodes Value of Type defined in the ASN.1 module Module . Returns a possibly nested list of bytes and or binaries if successful. If Module was compiled with the options per_bin and optimize the result is a binary. To get as fast execution as possible the encode function only performs rudimentary tests that the input Value is a correct instance of Type . The length of strings is for example not always checked. info(Module) -> {ok,Info} | {error,Reason} Types Module = atom() Info = list() Reason = term() info/1 returns the version of the asn1 compiler that was used to compile the module. It also returns the compiler options that was used. load_driver() -> ok | {error,Reason} Types Reason = term() This function loads the linked-in driver before the first call to encode. If this function is not called the driver will be loaded automatically at the first call to encode. If one doesn't want the performance cost of a driver load when the application is run- ning, this function makes it possible to load the driver in an initialization. The driver is only used when encoding/decoding ASN.1 files that were compiled with the options per_bin and optimize . unload_driver() -> ok | {error,Reason} Types Reason = term() This function unloads the linked-in driver. When the driver has been loaded it remains in the environment until it is unloaded. Nor- mally the driver should remain loaded, it is crucial for the performance of ASN.1 encoding. The driver is only used when ASN.1 modules have been compiled with the flags per_bin and optimize . utf8_binary_to_list(UTF8Binary) -> {ok,UnicodeList} | {error,Reason} Types UTF8Binary = binary() UnicodeList = [integer()] Reason = term() utf8_binary_to_list/1 Transforms a UTF8 encoded binary to a list of integers, where each integer represents one character as its unicode value. The function fails if the binary is not a properly encoded UTF8 string. utf8_list_to_binary(UnicodeList) -> {ok,UTF8Binary} | {error,Reason} Types UnicodeList = [integer()] UTF8Binary = binary() Reason = term() utf8_list_to_binary/1 Transforms a list of integers, where each integer represents one character as its unicode value, to a UTF8 encoded binary. validate(Module,Type,Value) -> ok | {error,Reason} Types Module = Type = atom() Value = term() Validates that Value conforms to Type from Module . Not implemented in this version of the ASN.1 application. Ericsson AB asn1 1.6.16 asn1rt(3erl)
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy