Sponsored Content
Full Discussion: Text parsing
Top Forums Shell Programming and Scripting Text parsing Post 302912013 by protocomm on Tuesday 5th of August 2014 07:30:02 AM
Old 08-05-2014
Code:
 awk -F"[:,]" '{if ($1~/@2 line/){print $1": <XO>"$2"<XC,\""$2"\",\"\",\"\",\"\",0,0,\"\">,<XO>"$3"\",\"\",\"\",\"\",0,0,\"\">"}else{print $0}}' file

This User Gave Thanks to protocomm For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text parsing question

How would I split a file based on the location of a string, basically I want all entries above the string unix in this example 1 2 3 4 unix 5 6 7 Thanks, Chuck (3 Replies)
Discussion started by: 98_1LE
3 Replies

2. Shell Programming and Scripting

Text File Parsing

Hey Guys.I am a newbie on Bash Shell Scripting and Perl.And I have a question about file parsing. I have a log file which contains reports about a communication device.I need to take some of the reports from the log file.Its hard to explain the issue.but shortly I can say that, the reports has a... (2 Replies)
Discussion started by: Djlethal
2 Replies

3. Shell Programming and Scripting

Parsing text from file

Any ideas? 1)loop through text file 2)extract everything between SOL and EOL 3)output files, for example: 123.txt and 124.txt for the file below So far I have: sed -n "/SOL/,/EOL/{p;/EOL/q;}" file Here is an example of my text file. SOL-123.go something goes here something goes... (0 Replies)
Discussion started by: ndnkyd
0 Replies

4. Shell Programming and Scripting

Parsing text

Hello all, I have some text formatted as follows Name: John doe Company: Address 1: 7 times the headache Address 2: City: my city State/Province: confusion Zip/Postalcode: 12345 and I'm trying to figure out how I could extract the data after the colon so that the result would be ... (6 Replies)
Discussion started by: mcgrailm
6 Replies

5. Shell Programming and Scripting

Need help parsing a text file

I have a text file: router1#sh ip blah blah | incl --- Gi2/8 10.60.4.181 --- 10.60.123.175 11 0000 0000 355K Gi2/8 10.60.83.28 --- 224.10.10.26 11 F9FF 3840 154K Gi2/8 10.60.83.198 --- ... (1 Reply)
Discussion started by: streetfighter2
1 Replies

6. Shell Programming and Scripting

Help with text/number parsing

Hello I have a file that contains 10 rows as below: "ID" "DP" "ID=GRMZM2G015073_T01" "23.6044288292005" "ID=GRMZM2G119852_T01" "59.7782287606723" "ID=GRMZM2G100242_T02" "61.4167813736184" "ID=GRMZM2G046274_T01" "6.63061838134219" "ID=GRMZM2G046274_T02" ... (5 Replies)
Discussion started by: cs_novice
5 Replies

7. Programming

Parsing a Text file using C++

I was trying to parse the text file, which will looks like this ###XYZABC#### ############ int = 4 char = 1 float = 1 . . ############ like this my text file will contains lots of entries and I need to store these entries in the map eg. map.first = int and map.second = 4 same way I... (5 Replies)
Discussion started by: agupta2
5 Replies

8. Shell Programming and Scripting

Parsing text file

I'm totally stumped with how to handle this huge text file I'm trying to deal with. I really need some help! Here is what is looks like: ab1ba67c331a3d731396322fad8dd71a3b627f89359827697645c806091c40b9 0.2 812a3c3684310045f1cb3157bf5eebc4379804e98c82b56f3944564e7bf5dab5 0.6 0.6... (3 Replies)
Discussion started by: comp8765
3 Replies

9. Shell Programming and Scripting

Parsing text file

Hi Friends, I am back for the second round today - :D My input text file is this way Home friends friendship meter Tools Mirrors Downloads My Data About Us Help My own results BLAT Search Results ACTIONS QUERY SCORE START END QSIZE IDENTITY CHRO STRAND ... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

10. Shell Programming and Scripting

Parsing blocked text

I do have a flat text file that are divided into blocks. Each block is demimited by '='. I would like to parse certain numbers and letters. This is the format of the file I have. It has thousands of such blocks >A B 1, 100 TTTT 100 95 >C D 1, 95 GHJKL = >A B 1, 72 GHUJKLO 72 84 >C D... (3 Replies)
Discussion started by: Kanja
3 Replies
gencat(1)							   User Commands							 gencat(1)

NAME
gencat - generate a formatted message catalog SYNOPSIS
gencat catfile msgfile... DESCRIPTION
The gencat command merges the message text source file(s) msgfile into a formatted message database catfile. The database catfile is cre- ated if it does not already exist. If catfile does exist, its messages are included in the new catfile. If set and message numbers col- lide, the new message-text defined in msgfile replaces the old message text currently contained in catfile. The message text source file (or set of files) input to gencat can contain either set and message numbers or simply message numbers, in which case the set NL_SETD (see nl_types.h(3HEAD)) is assumed. Message Text Source File Format The format of a message text source file is defined as follows. Note that the fields of a message text source line are separated by a sin- gle ASCII space or tab character. Any other ASCII spaces or tabs are considered as part of the subsequent field. $set n comment Where n specifies the set identifier of the following messages until the next $set, $delset, or end-of-file appears. n must be a number in the range (1-{NL_SETMAX}). Set identifiers within a single source file need not be contiguous. Any string following the set identifier is treated as a comment. If no $set directive is specified in a message text source file, all messages are located in the default message set NL_SETD. $delset n comment Deletes message set n from an existing message catalog. Any string following the set number is treated as a com- ment. (Note: if n is not a valid set it is ignored.) $comment A line beginning with a dollar symbol $ followed by an ASCII space or tab character is treated as a comment. m message-text The m denotes the message identifier, a number in the range (1-{NL_MSGMAX}). The message-text is stored in the message catalog with the set identifier specified by the last $set directive, and with message identifier m. If the message-text is empty, and an ASCII space or tab field separator is present, an empty string is stored in the mes- sage catalog. If a message source line has a message number, but neither a field separator nor message-text, the existing message with that number (if any) is deleted from the catalog. Message identifiers need not be contiguous. The length of message-text must be in the range (0-{NL_TEXTMAX}). $quote c This line specifies an optional quote character c, which can be used to surround message-text so that trailing spa- ces or null (empty) messages are visible in a message source line. By default, or if an empty $quote directive is supplied, no quoting of message-text will be recognized. Empty lines in a message text source file are ignored. Text strings can contain the special characters and escape sequences defined in the following table: +--------------------------------------------------------------+ |Description Symbol Sequence | |newline NL(LF) | |horizontal tab HT | |vertical tab VT v | |backspace BS  | |carriage return CR | |form feed FF f | |backslash \ | |bit pattern ddd ddd | +--------------------------------------------------------------+ The escape sequence ddd consists of backslash followed by 1, 2 or 3 octal digits, which are taken to specify the value of the desired character. If the character following a backslash is not one of those specified, the backslash is ignored. Backslash followed by an ASCII newline character is also used to continue a string on the following line. Thus, the following two lines describe a single message string: 1 This line continues to the next line which is equivalent to: 1 This line continues to the next line OPERANDS
The following operands are supported: catfile A path name of the formatted message catalog. If - is specified, standard output is used. msgfile A path name of a message text source file. If - is specified for an instance of msgfile, standard input is used. The format of message text source files is defined in Message Text Source File Format. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of gencat: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWloc | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
mkmsgs(1), catgets(3C), catopen(3C), gettxt(3C), nl_types.h(3HEAD), attributes(5), environ(5), standards(5) SunOS 5.10 1 Feb 1995 gencat(1)
All times are GMT -4. The time now is 01:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy