Sponsored Content
Top Forums Shell Programming and Scripting Appending CRLF to end of record Post 302929250 by abhilashnair on Friday 19th of December 2014 04:50:08 AM
Old 12-19-2014
Code:
awk '{$0=$0 ~ /\|\r\n$/?$0:$0"|\r\n"} 1' filename>output

worked for me
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

appending spaces to first line based on second record.

Hi, I have a situation to append spaces to end of first record (header)and last record (footer) based on second record length. The first record length is always 20.The second record will be different for different files.I have to append spaces for the first line based on second record... (2 Replies)
Discussion started by: ammu
2 Replies

2. Shell Programming and Scripting

appending date at the end of the file

I have file called xx Now i want to rename this file as xxYYYYMMDD_HHMIAM.xls Here is my code.. export DATE1=`date +%Y%m%d` mv xx xx$DATE1 This code renames as xxYYYYMMDD Now how can i append HHMIAM at the end of the file? Any help is appreciated... (3 Replies)
Discussion started by: govindts
3 Replies

3. Shell Programming and Scripting

Appending string at the end of the file

Hello, I wanted to append 'XYZ' at the end of the text file. How can i do this? I searched the forums and i am not getting what i want. Any help is highly appreciated. Thanks (2 Replies)
Discussion started by: govindts
2 Replies

4. Shell Programming and Scripting

Appending data to the end of a line

I have searched the forms and I can not find info on appending each line of one file to the same line of another file. I know that I can cat one file to another or append the 2nd file to the end of the 1st but not quite sure how to append one line of data to another. For example File 1 has ... (2 Replies)
Discussion started by: scw132
2 Replies

5. UNIX for Dummies Questions & Answers

Sed $ appending to front, not to the end

I keep trying to append some astrix to the end of a line, but it keeps overwriting at the front of the line. These are the originals Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900 Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900 ... (5 Replies)
Discussion started by: DrSammyD
5 Replies

6. Shell Programming and Scripting

Appending a new field at the end in a file

can anyone tell me please ......how to append a new field at the end of a file with the help of sed or some other command in bourne shell (8 Replies)
Discussion started by: amitpta
8 Replies

7. UNIX for Dummies Questions & Answers

Confusion with CRLF (wint) and LF (unix) as end of line seperators

I know that windows uses CRLF as a end of line character while Unix uses LF. But visually i could not see any difference in files while creating on either of plat forms. CR (Carriage Return) means to bring cursor to beginning of line while LF (Line feed) means to bring cursor to next line... (5 Replies)
Discussion started by: sarbjit
5 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Appending beginning of filename to end

Hi Guys, I have serveral directories like this: (2013) blablabla(blabla) - blabla (blabla) or (1997) blablabla(blabla) - blabla (blabla) and have to rename them to something like that: blablabla(blabla) - blabla (blabla) (2013) and blablabla(blabla) - blabla (blabla) (1997) Easy... (2 Replies)
Discussion started by: Nateshift
2 Replies

9. Shell Programming and Scripting

Appending ErrorCodes to the corresponding error record

Hi, Here i'm using a awk inside bash script to validate the datafile by referring to the configuration file(schema file). Here the validation check is done for datatype, field length and null values. Once the validation is done on data file the error records are moved to the bad file. So... (22 Replies)
Discussion started by: shree11
22 Replies

10. UNIX for Dummies Questions & Answers

Appending | (pipe) to end of each line which does not have it

I have a text file in which all records end with pipe character and newline, but a few do not have a pipe at the end. Something like this 1|John|32|US| 2|Matt|35|UK 3|Rex|36|EU| So in the above example the second line does not have a pipe at the end My requirement is to append a... (5 Replies)
Discussion started by: abhilashnair
5 Replies
srec_ti_tagged_16(5)						File Formats Manual					      srec_ti_tagged_16(5)

NAME
srec_ti_tagged_16 - Texas Instruments Tagged (SDSMAC 320) file format DESCRIPTION
This format is also known as the TI-Tagged or Texas Instruments SDSMAC (320) format. This format allows binary files to be uploaded and downloaded between two computer systems, typically between a computer system (such as a PC, Macintosh, or workstation) and an emulator or evaluation board for 16-bit microcontrollers and microprocessors. The Lines Unlike many other object formats, the lines themselves are not especially significant. The format consits of a number of tagged fields, and lines are composed of a series of these fields. Tag Description ------------------------------------- * Data byte. : End of file. 0 File header (optional). 7 Checksum. 8 Dummy checksum (ignored). 9 Word Address. B Data word. F End of data record. K Program identifier (optional). Data Byte +--+---+---+ |B | n | n | One byte of data. The nn is 8-bit big-endian hexadecimal. +--+---+---+ End of File +--+------+ |: | CRLF | The end of data is indicated by this tag. The end of line sequence+(LF-on+Unix systems, CRLF on PCs) follows this tag. File Header +--+--------+----------+ |0 | length | filename | The optional start-of-file record begins with a tag character+('0')-and-a-12-character file header. The first four characters are the count (in hex) of the 16-bit data word values (B) which follow, not including data byte values (*). The remaining file header characters are the name of the file and may be any ASCII characters, blank padded. Checksum +--+---+---+---+---+ |7 | n | n | n | n | The checksum is the 2s complement sum of the 8-bit ASCII values-of-characters, beginning with the first tag character and ending with the checksum tag character (7). The nnnn is 16-bit big-endian hexadecimal. Dummy Checksum +--+---+---+---+---+ |8 | n | n | n | n | The checksum is the 2s complement sum of the 8-bit ASCII values+of-characters,-beginning with the first tag character and ending with the checksum tag character (8). The nnnn is 16-bit big-endian hexadecimal. Address +--+---+---+---+---+ |9 | n | n | n | n | Addresses may be given for any data byte, but none is mandatory.--The-file+begins at 0000 if no address is given before the first data field. The nnnn is 16-bit big-endian hexadecimal. Data Word +--+---+---+---+---+ |B | a | a | b | b | Two bytes of data. The aa and bb are each 8-bit big-endian hexadecimal.---+---+ End of Record +--+------+ |F | CRLF | The end of line sequence (LF on Unix systems, CRLF on PCs) is escaped-using this tag. The checksum is reset to zero at this point. Program Identifier +--+---+---+---+---+------+ |K | n | n | n | n | text | The program identifier can contain a brief description of-the-program,-or-can-be-empty (i.e. the text portion is optional). The nnnn length (hex) of the field includes the `K', the length and the text; it is at least 5. Size Multiplier In general, binary data will expand in sized by approximately 2.9 times when represented with this format. EXAMPLE
Here is an example TI-Tagged file. It contains the data "Hello, World[rq] to be loaded at address 0x0100. K000590080B4865B6C6CB6F2CB2057B6F72B6C64*0A7F641F : Here is another example from the reference below 00028 7FDCFF 90000BFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFF7F400F 90008BFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFF7F3F8F 90010BFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFF7F3FFF 90018BFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFF7F3F7F 90020BFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFFBFFFF7F3FEF : SEE ALSO
http://www.dataio.com/pdf/Manuals/Unifamily/981-0014-016.pdf (page 6-7) 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_ti_tagged_16(5)
All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy