10-26-2009
add character to every end-of line in file
Hi All
I have a file which conatins record.the length of every records is 47.
problem : in the end of record i don't have a "\015" character.
i want to add this "\015" charcter in the end of every record.
the file contains something like 700 records.
i've tried with sed command - nothing.
can someone help me how i should do it ?
thanks in advanced
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi, I've got a file where in the middle of the record is a $ end of line character, visible only when I open the file in vi and do :set list. How to I get rid of the character in the middle and keep it at the end. The middle $ character always appears after SW, so that can be used to tag it.... (3 Replies)
Discussion started by: bwrynz1
3 Replies
2. UNIX for Dummies Questions & Answers
HI i am having a file this
(sys19:pnlfct:/pfact/temp>) cat temp_sand
1234567890
1234567890
1234567890
1234567890
I want to make this file as
(sys19:pnlfct:/pfact/temp>) cat temp_sand
1456789023
1456789023
1456789023
1456789023
just take the 2nd and 3rd position and put it... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
3. UNIX for Dummies Questions & Answers
hi all, i have this question: How to add new line character at the end of a file????
i need this because i am loading a file to sybase and i have problems with the last record
thanks for your help (5 Replies)
Discussion started by: DebianJ
5 Replies
4. Shell Programming and Scripting
Hi,
i want to append a character '|' at end of each line of a file abc.txt.
for example if the file abc.txt conatins:
a|b|c
1|2|33
w|2|11
i want result file xyz.txt
a|b|c|
1|2|33|
w|2|11|
I know this is simple but sumhow i am not able to reach end of line.
its urgent, thanks for... (4 Replies)
Discussion started by: muaz
4 Replies
5. Shell Programming and Scripting
hi all
i have 32 lines in file. the length of each line is 82 , i want that in the end of each line , means in postion 83-84 to put two characters 0d(=\015), 0a(=\012)
i want that the 0d will be in postion 83
and the 0a will be in postion 84
in each line of the file
how shall i do it ?
... (7 Replies)
Discussion started by: naamas03
7 Replies
6. Shell Programming and Scripting
I need to remove new line character from end of file.
Suppose here are content.
a|b|c|d|r
a|b|c|d|r
a|b|c|d|r
<new line>
that means file contains 4 lines but data is there in 3 lines.
so I want that only 3 lines should be there in file.
Please help (20 Replies)
Discussion started by: varun940
20 Replies
7. Shell Programming and Scripting
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
Discussion started by: RahulJoshi
6 Replies
8. Shell Programming and Scripting
Hai,
I have got a small requirement in my script. and i am using bash shell. I need to add a dot (.) for some particular line in a file. Say for example,
$Cat rmfile
1 This is line1
2 This is line2
3 This is line3
O/p should be :
$Cat rmfile
1 This is line1
2 This is line2. #... (2 Replies)
Discussion started by: Sivajee
2 Replies
9. Shell Programming and Scripting
Hi All,
I have following piece of code in UNIX C Shell script and I want to add one more command which can add newline at the end of file only if there is no newline character exists.
foreach file (`ls $dd_PLAYCARD_EDI_IN`)
if ( -f $dd_PLAYCARD_EDI_IN/${file} ) then
cat -n... (4 Replies)
Discussion started by: jnrohit2k
4 Replies
10. Shell Programming and Scripting
Hi,
I would like have a shell script to check every line in a file to see if it ends with ";". If this is NOT the last character ";" should be added.
MyFile.csv :
web9331801;01/01/2014 23:39:35;;"93962";353150256;
web9331802;01/01/2014 23:44:29;;"479288";353153538;
web9331803;01/01/2014... (14 Replies)
Discussion started by: vg77
14 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)