07-06-2012
Quote:
Originally Posted by
elixir_sinari
And how do you make out the end/beginning of any record?
All records end with a new line. Each record has 12 fields separated by "|". If the field contains multiple words with spaces or new lines, then is enclosed with "^".
My problem is I'm not so experienced with regular expresions. I never neded to parse a field from a record wich splits multiple lines...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Can some one tell, how to replace ascii non printable TAB from the while to something, then later on replace it back to TAB.
Basciallz we do bulk data processing, our processin treats TAB as new field ,
So I thought we can replace it with something and later on revert it.
TIA (4 Replies)
Discussion started by: braindrain
4 Replies
2. Shell Programming and Scripting
:rolleyes: Hi,
I want to replace the particular text in the middle of the line.
Ex. In the line 40-50 wanted to replace the char as 'x' (7 Replies)
Discussion started by: Jairaj
7 Replies
3. Shell Programming and Scripting
I know this has been asked previously on this forum...But I think I have a different scenario to present.
I ahve a file tht looks like this (note:there are control Z and other chars tht are not visible on line with anme bowers)
BB7118450 6004718 BIANCALANA =HEI
BZ5842819 ... (4 Replies)
Discussion started by: alfredo123
4 Replies
4. Shell Programming and Scripting
Hi,
How to replace any character in a file with a newline character using sed ..
Ex:
To replace ',' with newline
Input:
abcd,efgh,ijkl,mnop
Output:
abcd
efgh
ijkl
mnop
Thnx in advance.
Regards,
Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies
5. Shell Programming and Scripting
Hi!
I'm having trouble usind sed to remove the char ' from within a database's varchar register's sql.
For example, on the following sql:
INSERT INTO patrimonio_municipal.patrimonio_municipal_airc_tmp
Values('|Estação Elevatória|',|16723|,'|Grandes Reparações|',
'|2010-03-26... (3 Replies)
Discussion started by: cremat0rio
3 Replies
6. Shell Programming and Scripting
Hi ,
I have problem on replace char on text file
#!/bin/bash
echo "Enter Third value : "
read a
sed '2 s/192.160.1.1/cut -d"." -f3/$a/g' tcpip.txt > a.txt
I want replace line 2 on tcpip.txt with value a that I input but it's not run
Please help me (2 Replies)
Discussion started by: phillipss
2 Replies
7. Shell Programming and Scripting
Hi Guys,
I wand find and replace all Extended ASCII Codes from all my log files.
My Log files:
/home/Kalr/PPool/Output
i have logs file in sub dir.
/home/Kalr/PPool/Output/X
/home/Kalr/PPool/Output/Y
/home/Kalr/PPool/Output/Z
My Abc.log file input:
Extended ASCII Codes :–
... (4 Replies)
Discussion started by: asavaliya
4 Replies
8. UNIX for Dummies Questions & Answers
Hi
I've a string . And i need to replace set of characters with a single character
Means .. or . or ... and so on should be replaced with single % character
Irrespective of number of dots in between the characters , those should be replaced with single %
All the above strings should be... (3 Replies)
Discussion started by: smile689
3 Replies
9. UNIX for Dummies Questions & Answers
HI All
Im trying to come up with an approach to finding a string, using a portion of that string to insert it on lines starting with the value "GOTO" appending to end of line after removing PT's ( See example below! )
EXAMPLE:
1. I would like to search for the line that starts with "TLAXIS/"... (7 Replies)
Discussion started by: graymj
7 Replies
10. UNIX for Advanced & Expert Users
File is pipe delimited with 17 fields. We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n in data with space and not the Ture \n that is line separator.
I tried below awk command it did not work as expected.
awk '(NR-1)%2{$1=$1}1' RS=\|... (9 Replies)
Discussion started by: rajeshkumare
9 Replies
LEARN ABOUT DEBIAN
srec_emon52
srec_emon52(5) File Formats Manual srec_emon52(5)
NAME
srec_emon52 - Elektor Monitor (EMON52) file format
DESCRIPTION
This format is used by the monitor EMON52, developed by the European electronics magazine Elektor (Elektuur in Holland). Elektor wouldn't
be Elektor if they didn't try to reinvent the wheel. It's a mystery why they didn't use an existing format for the project. Only the
Elektor Assembler will produce this file format, reducing the choice of development tools dramatically.
Records
All data lines are called records, and each record contains the following four fields:
+---+------+---+-----------+------+
|cc | aaaa | : | dd ... dd | ssss |
The field are defined as follows: +---+------+---+-----------+------+
cc The byte count. A two digit hex value (1 byte), counting the actual data bytes in the record. The byte count is separated from
the next field by a space.
aaaa The address field. A four hex digit (2 byte) number representing the first address to be used by this record.
: The address field and the data field are separated by a colon.
dd The actual data of this record. There can be 1 to 255 data bytes per record (see cc) All bytes in the record are separated from
each other (and the checksum) by a space.
ssss Data Checksum, adding all bytes of the data line together, forming a 16 bit checksum. Covers only all the data bytes of this
record.
Please note that there is no End Of File record defined.
Byte Count
The byte count cc counts the actual data bytes in the current record. Usually records have 16 data bytes. I don't know what the maximum
number of data bytes is. It depends on the size of the data buffer in the EMON52.
Address Field
This is the address where the first data byte of the record should be stored. After storing that data byte, the address is incremented by
1 to point to the address for the next data byte of the record. And so on, until all data bytes are stored.
The address is represented by a 4 digit hex number (2 bytes), with the MSD first.
Data Field
The payload of the record is formed by the Data field. The number of data bytes expected is given by the Byte Count field.
Checksum
The checksum is a 16 bit result from adding all data bytes of the record together.
Size Multiplier
In general, binary data will expand in sized by approximately 3.8 times when represented with this format.
EXAMPLE
Here is an example of an EMON52 file:
10 0000:57 6F 77 21 20 44 69 64 20 79 6F 75 20 72 65 61 0564
10 0010:6C 6C 79 20 67 6F 20 74 68 72 6F 75 67 68 20 61 05E9
10 0020:6C 6C 20 74 68 69 73 20 74 72 6F 75 62 6C 65 20 05ED
10 0030:74 6F 20 72 65 61 64 20 74 68 69 73 20 73 74 72 05F0
04 0040:69 6E 67 21 015F
SEE ALSO
http://sbprojects.fol.nl/knowledge/fileformats/emon52.htm
AUTHOR
This man page was taken from the above Web page. It was written by San Bergmans <sanmail@bigfoot.com>
Reference Manual SRecord srec_emon52(5)