Sponsored Content
Top Forums Shell Programming and Scripting Delete the last empty/blank line of the text file Post 302567518 by zaxxon on Monday 24th of October 2011 10:56:57 AM
Old 10-24-2011
Please post the output of
Code:
od -c file.txt

using code tags. Replace confidential data, just in case, thanks. ANd which editor do you use?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to get rid of blank line in a flat text file

Hi, I have a flat text file which contains blank line between each text line. Is there any command to get rid of it? Thanks for your help (11 Replies)
Discussion started by: xfang
11 Replies

2. Shell Programming and Scripting

how to delete a first blank line from the file

I have a file which has the first blank line: sundev22$cat /t1/bin/startallocs /t1/bin/startallocsys 123 sundev22$ Is there a command to remove this first blank line? Thanks for help -A (4 Replies)
Discussion started by: aoussenko
4 Replies

3. Shell Programming and Scripting

Fill the empty line by adding line before blank line

FIle A "A" 2 aa 34 3 ac 5 cd "B" 3 hu 67 4 fg 5 gy output shud be A"" 2 aa 34 "A" 3 ac 34 "A" 5 cd 34 "B" 3 hu 67 "B" 4 fg 67 "B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies

4. Shell Programming and Scripting

Sed insert text at first line of empty file

I can't seem to get sed to allow me to insert text in the first line of an empty file. I have a file.txt that is a 0 byte file. I want sed to insert " fooBar" onto the first line. I've tried a few options and nothing seems to work. They work just fine if there's text in the file tho. Help? (4 Replies)
Discussion started by: DC Slick
4 Replies

5. Shell Programming and Scripting

how to scan for the empty or blank line

I am having a text file sample.txt The contents of the sample.txt is as follows. ____________ aaa,bbb ccc,ddd ____________ first line contains aaa,bbb second line is blank third line contains ccc,ddd Now I need to write a script to search in the file sample.txt. If it contains... (4 Replies)
Discussion started by: kmanivan82
4 Replies

6. Shell Programming and Scripting

delete blank line from middle of a file

All, I have a file which contains two entry with spaces (either one or more than one space). ex. /tmp/scripts/sql CUST_YR_END_INI.sql /tmp/scripts/sql CUST_WK_END_INI.sql /tmp/scripts/sql CUST_MTH_END_INI.sql /tmp/scripts/sql CUST_YR_END_INC.sql now I want to... (11 Replies)
Discussion started by: anshu ranjan
11 Replies

7. Shell Programming and Scripting

How to remove blank line from a text file?

Hi All, I am creating a text file using perl. The first record I am writing as "$line" and all the other as "\n$line". At the end the file is having N number of lines. I am using this file for MLOAD (Teradata), which is reading N+1 lines in the file and failing.I am not able to find new line... (2 Replies)
Discussion started by: unankix
2 Replies

8. Shell Programming and Scripting

Delete blank line in regular file

Hi all, I have file1 with line blank e.g. $cat file1 aaa 111 222 333 444 bbb 555 666 777 888 ccc ddd 1010 1010 1010 eee then i need delete the lines blank (3 and 5) so show $cat file1 aaa 111 222 333 444 bbb 555 666 777 888 ddd 1010 1010 1010 (5 Replies)
Discussion started by: aav1307
5 Replies

9. Shell Programming and Scripting

Tried many options but unable to delete blank lines from text file

Hi, I tried the following options but was unable to delete blank lines from file Input file = temp.hash.txt temp.hash.txt content 90 0 89.56 0 0 57575.4544 56.89 (9 Replies)
Discussion started by: uuuunnnn
9 Replies

10. Shell Programming and Scripting

Delete everything after empty line in file

Hello, I am trying to remove everything coming after empty line under ubuntu14.04. How may I do it? file: aaa 020390 bb00id3 c03wisi 209dl x092sia 0290s I expect: aaa 020390 bb00id3 c03wisi (3 Replies)
Discussion started by: baris35
3 Replies
WRJPGCOM(1)						      General Commands Manual						       WRJPGCOM(1)

NAME
wrjpgcom - insert text comments into a JPEG file SYNOPSIS
wrjpgcom [ -replace ] [ -comment text ] [ -cfile name ] [ filename ] DESCRIPTION
wrjpgcom reads the named JPEG/JFIF file, or the standard input if no file is named, and generates a new JPEG/JFIF file on standard output. A comment block is added to the file. The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. Although the standard doesn't actually define what COM blocks are for, they are widely used to hold user-supplied text strings. This lets you add annotations, titles, index terms, etc to your JPEG files, and later retrieve them as text. COM blocks do not interfere with the image stored in the JPEG file. The maximum size of a COM block is 64K, but you can have as many of them as you like in one JPEG file. wrjpgcom adds a COM block, containing text you provide, to a JPEG file. Ordinarily, the COM block is added after any existing COM blocks; but you can delete the old COM blocks if you wish. OPTIONS
Switch names may be abbreviated, and are not case sensitive. -replace Delete any existing COM blocks from the file. -comment text Supply text for new COM block on command line. -cfile name Read text for new COM block from named file. If you have only one line of comment text to add, you can provide it on the command line with -comment. The comment text must be sur- rounded with quotes so that it is treated as a single argument. Longer comments can be read from a text file. If you give neither -comment nor -cfile, then wrjpgcom will read the comment text from standard input. (In this case an input image file name MUST be supplied, so that the source JPEG file comes from somewhere else.) You can enter multiple lines, up to 64KB worth. Type an end-of-file indicator (usually control-D) to terminate the comment text entry. wrjpgcom will not add a COM block if the provided comment string is empty. Therefore -replace -comment "" can be used to delete all COM blocks from a file. EXAMPLES
Add a short comment to in.jpg, producing out.jpg: wrjpgcom -c "View of my back yard" in.jpg > out.jpg Attach a long comment previously stored in comment.txt: wrjpgcom in.jpg < comment.txt > out.jpg or equivalently wrjpgcom -cfile comment.txt < in.jpg > out.jpg SEE ALSO
cjpeg(1), djpeg(1), jpegtran(1), rdjpgcom(1) AUTHOR
Independent JPEG Group 15 June 1995 WRJPGCOM(1)
All times are GMT -4. The time now is 07:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy