03-02-2019
one of the most progressive inventions by our genius Ken Thompson was, that *NIX regards files as simple byte streams, whereas fixed sized records are a anachronistic relic of mainframes. *NIX "records" always are delimited by a special character.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. UNIX for Dummies Questions & Answers
Hi ,
I have a peculiar case, where my sed command is working on a file which contains lines of small length.
sed "s/XYZ:1/XYZ:3/g" abc.txt > xyz.txt
when abc.txt contains lines of small length(currently around 80 chars) , this sed command is working fine.
when abc.txt contains lines of... (3 Replies)
Discussion started by: thanuman
3 Replies
3. UNIX for Dummies Questions & Answers
Hi Guys,
Could anyone shed some light on the length of a Unix filepath max length pls ?
thanks !
Wilson (3 Replies)
Discussion started by: wilsontan
3 Replies
4. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
5. Shell Programming and Scripting
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies
6. Shell Programming and Scripting
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies
7. Shell Programming and Scripting
Hello Everyone,
I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table.
Input Data-
------ ------------------------ ---- -----------------
WFI001 Xxxxxx Control Work Item A Number of Records
------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies
8. Shell Programming and Scripting
Hello All,
I have this script that does stuff like "starting, stopping & restarting" a Daemon Process running on my machine...
My main question is why in part of my code (which you will see below) does the Array Length (i.e. ${#PIDS} )
return "1" when I know the Array is empty..?
Here is... (17 Replies)
Discussion started by: mrm5102
17 Replies
9. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
LEARN ABOUT DEBIAN
srec_stewie
srec_stewie(5) File Formats Manual srec_stewie(5)
NAME
srec_stewie - Stewie's binary file format
DESCRIPTION
If you have a URL for documentation of this format, please let me know.
Any resemblance to the Motorola S-Record is superficial, and extends only to the data records. The header records and termination records
are completely different. None of the other Motorola S-Records record type are available.
The Records
All records start with an ASCII capital S character, value 0x53, followed by a type specifier byte. All records consist of binary bytes.
The Header Record
Each file starts with a fixed four byte header record.
+-----+------+------+------+
|0x53 | 0x30 | 0x30 | 0x33 |
+-----+------+------+------+
The Data Records
Each data record consists of 5 fields. These are the type field, length field, address field, data field, and the checksum. The lines
always start with a capital S character.
+-----+------+---------------+---------+------+----------+
|0x53 | Type | Record Length | Address | Data | Checksum |
+-----+------+---------------+---------+------+----------+
Type The type field is a one byte field that specifies whether the record has a two-byte address field (0x31), a three-byte address
field (0x32) or a four-byte address field (0x33). The address is big-endian.
Record Length
The record length field is a one byte field that specifies the number of bytes in the record following this byte.
Address This is a 2-, 3- or 4-byte address that specifies where the data in the record is to be loaded into memory.
Data The data field contains the executable code, memory-loadable data or descriptive information to be transferred.
Checksum
The checksum is a one byte field that represents the least significant byte of the one's complement of the sum of the values repre-
sented by the bytes making up the record's length, address, and data fields.
The Termination Record
Each file ends with a fixed two byte termination record.
+-----+------+
|0x53 | 0x38 |
+-----+------+
Size Multiplier
In general, binary data will expand in sized by approximately 1.2 times when represented with this format.
EXAMPLE
Here is an hex-dump example file. It contains the data "Hello, World[rq] to be loaded at address 0.
0000: 53 30 30 33 53 31 10 00 00 48 65 6C 6C 6F 2C 20 S003S1...Hello,
0010: 57 6F 72 6C 64 0A 9D 53 38 World..S8
COPYRIGHT
srec_cat version 1.58
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Peter Miller
The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use the 'srec_cat -VERSion License' command. This is free software and
you are welcome to redistribute it under certain conditions; for details use the 'srec_cat -VERSion License' command.
AUTHOR
Peter Miller E-Mail: pmiller@opensource.org.au
//* WWW: http://miller.emu.id.au/pmiller/
Reference Manual SRecord srec_stewie(5)