Remove new line character and add space to convert into fixed width file
I have a file with different record length. The file as to be converted into fixed length by appending spaces at the end of record. The length should be calculated based on the record with maximum length in the file.
If the length is less than the max length, the spaces should be appended before the new line character of that record.
Source File:
abcdefghijklmnop01qrstuvwxyz
abcdefghijklmnop02qrstuvwxyz
abcdefghijklmnop03qrstuvwxyz
abcdefghijklmnop04qrstuvwxyz
abcdefghijklmnop05qrstuvwxyz
Whatever characters are in 17-18 on each line of the file, it should be concatenated to the same line at the character number... (6 Replies)
Hi,
How to output the duplicate record to another file. We say the record is duplicate based on a column whose position is from 2 and its length is 11 characters.
The file is a fixed width file.
ex of Record:
DTYU12333567opert tjhi kkklTRG9012
The data in bold is the key on which... (1 Reply)
Hi Experts,
I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line.
File is comma (,) seperated.
Eg:
ID,Client ,SNo,Rank
37,Airtel \n... (8 Replies)
Hello gurus,
I have a file containing 5 columns delimited by '#' as shown in the example below:
HRP1000-PLVAR#HRP1000-OTYPE#HRP1000-OBJID#HRP1000-BEGDA#HRP1000-ENDDA#
99991231#AU7129#000000000#1 PROCTER & GAMBLE#
99991231#TT4283#1000013883#21111 LAUNDRY#
99991231#TT4283#1000013884#21121 DISH... (3 Replies)
Input eg:
Ouput Expected.
The #rd line had the unexpted new line, which need to be replaced with space.
I was planing to go with checking the length of each line using awk and if the length is less than the defeined limit, (12 in above case) will replace the newline with space.
... (5 Replies)
Hi:)
I have a large file ( couple thousand lines ) and I'm trying to add a character after the first word/space on each line.
eg:
First line of text
Second line of text
Third line of text
Fourth line of text
Fifth line of text
I'd like to accomplish:
First - line of text
Second... (8 Replies)
Hi Forum.
I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type.
The main command in the script is:
awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Hi - this is a generic question .... is there any utility which can convert a fixed width file format to a delimited file (any given character delimited) ? (5 Replies)
Discussion started by: i4ismail
5 Replies
LEARN ABOUT DEBIAN
srec_brecord
srec_brecord(5) File Formats Manual srec_brecord(5)NAME
srec_brecord - Freescale MC68EZ328 Dragonball bootstrap record format
DESCRIPTION
This data format is understood by Freescale MC68EZ328 Dragonball series processors on their internal UART.
Lines
Each line contains hexadecimal data, each byte represented by two hexadecimal nybbles in upper case. Characters not in this set, but
larger than 0x30 (e.g. lower case) will be ignored, less than 0x30 (e.g. CR or LF) are considered record terminators. Comments are prob-
lematic; don't try this at home.
Fields
Each line contains a 4-byte address (big endian), a 1-byte length-and-mode, and then data bytes as dictated by the length. There is no
checksum. A zero length record is an execution start address record, non-zero length records are data.
+--+---+---+---+---+---+---+---+---+----+-----+---+
|1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ... | n |
+--+---+---+---+---+---+---+---+---+----+-----+---+
| Address | Length | Data |
+------------------------------+--------+---------+
The length-and-mode byte is formatted as follows:
+--+---+---+---+---+---+---+---+
|7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+--+---+---+---+---+---+---+---+
|Mode | R | Length |
+------+---+-------------------+
Mode These bits are ignored by SRecord in input (00 = bytes, 01 = half words, 10 is reserved, 11 = long words). These bits are always
zero on output by SRecord.
R This bit indicates a data read rather than a data write; SRecord does not accept input files with this bit set, and will not set it
on output.
Length The length of the records data bytes. It does not include the address or length bytes. The maximum payload of a record is 31
bytes of data.
Size Multiplier
In general, binary data will expand in sized by at least 2.35 times when represented with this format.
EXAMPLE
Here is an example b-record format file. It contains the data "Hello, World" to be loaded at address 0.
000000000D48656C6C6F2C20576F726C640A
SEE ALSO
http://www.freescale.com/files/32bit/doc/ref_manual/MC68VZ328UM.pdf
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_brecord(5)