Sponsored Content
Top Forums Shell Programming and Scripting Help to identify blank space in a file Post 303016114 by gimley on Thursday 19th of April 2018 08:26:22 PM
Old 04-19-2018
Many thanks for all your kind help. My broadband connectivity was down all day and hence the delay. All the solutions worked. I had ensured that my data had no trailing spaces so the issue of trailing spaces does not arise but is is nice to have a solution which ensures that trailing spaces are handled.
Thanks once again.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

append blank space

Hi, I would like to add blank space for fixed length(50) if length of string <30. Scenario: File Size AAA.CSV 123 BB.CSV 134 Expected: File Size AAA.CSV 123 BB.CSV 134 I want append blank space until 30 character. Thanks and Regards, HAA (1 Reply)
Discussion started by: HAA
1 Replies

2. Shell Programming and Scripting

Blank Space is not appending in each row of CSV File - Shell Script

I am calling SQL script in my UNIX Shell script and trying to create the CSV file and my last column value of each row is 23 blank spaces. In my SQL script,the last column is like below. RPAD(' ',23,' ') -- Padding 23 blank Spaces The CSV file is generated but the sapce(23 spaces) is... (2 Replies)
Discussion started by: praka
2 Replies

3. Shell Programming and Scripting

Removing blank lines from comma seperated and space seperated file.

Hi, I want to remove empty/blank lines from comma seperated and space seperated files Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies

4. Shell Programming and Scripting

Cut last blank space

Hello, I am using this to get only directories : ls -l | grep '^d'and here is the result : drwx------ 13 so_nic sonic 13 Nov 4 13:03 GLARY drwx------ 3 so_nic sonic 3 May 6 2010 PSY2R drwx------ 15 so_nic sonic 15 Oct 14 08:47 PSYR1 But I only need to keep this... (7 Replies)
Discussion started by: Aswex
7 Replies

5. UNIX for Dummies Questions & Answers

blank space

hi everyone, i have a problem in unix script , i need to remove line that has blank , not blank line . example: mahm,,jdggkhsd,ghskj,,fshjkl can anyone help? (4 Replies)
Discussion started by: Reham.Donia
4 Replies

6. Shell Programming and Scripting

Removing blank space in file

TT0000013101257 | JCJMMUJMMUB018 ... (0 Replies)
Discussion started by: sususa
0 Replies

7. Shell Programming and Scripting

Not delete space blank

Hi everyone, i need to "grep" a file with a string with space blanks, like this: grep "XXXX XX" file.txt The problem, i need put the "XXXX XX" in a string variable. When the script executes the grep, do: gresp XXXX XX file.txt How can i solve this problem? The... (5 Replies)
Discussion started by: Xedrox
5 Replies

8. Shell Programming and Scripting

Remove Space and blank line from file in UNIX shell script

I have below file. I want to remove space at begining of every line and then after also remove blank line from file. I use below code for each operation. sed -e 's/^*//' < check.txt > check1.txt sed '/^\s*$/d' < check1.txt > check2.txt above code not remove all the space... (12 Replies)
Discussion started by: Mohin Jain
12 Replies

9. Shell Programming and Scripting

How to check if the file is empty or has blank space.?

Hi, I am using KSH. I am trying to check if the output file is empty or not. I tried with ] but what i see is my file is empty but still manages to have a size of 1 instead of 0. But my file doesnot have anything its empty. I am not sure how to check this. can any one help? (10 Replies)
Discussion started by: Sharma331
10 Replies

10. Shell Programming and Scripting

How to identify exact text and then add a blank line above it using sed?

I need to identify the exact text of San Antonio Generator Running in the output my script which lands to a text file. Once SED finds the specific text, I need it to insert one line above the matched text. Here is what I have so far that isn't working all that well for me. Any help would be... (7 Replies)
Discussion started by: jbrass
7 Replies
XLITO(1)						      General Commands Manual							  XLITO(1)

NAME
xlito (XLoadImageTrailingOptions) - Append/Delete/Show a Trailing Option string in a file. SYNOPSIS
xlito [option] [string] files ... DESCRIPTION
xlito (XLoadImageTrailingOptions) is a utility that provides a file format independent way of marking image files with the appropriate options to display correctly. It does this by appending to a file, a string specified by the user. The string is marked with some magic numbers so that it can be extracted by a program that knows what to look for. Since almost all image files have some sort of image dimen- sion information in the file, the programs that load or manipulate these files generally do not look beyond the point at which they have read the complete image, so trailing information is safely be hidden. If appending this information causes trouble with other utilities, it can simply be deleted. Appropriate version of xloadimage (ie. xli 1.00) will recognise these trailing options at the end of the image files, and will treat the embedded string as if it were a sequence of command line Image Options. Any Global Options will be ignored, and unlike command line image Options, Trailing Options are never propagated to other images. Old versions of xloadimage (3.01 or less) can be made forward compatible by using the -x option to pull the trailing options out of the image files, and put them on the command line where xloadimage can see them. OPTIONS
The default behavior is to display the trailing option strings (if any) of the files on the argument line. The following options change the behavior of xlito: -c option_string file_name ... This adds or changes the embedded string to option_string. The string will have to be quoted if it is composed of more than one word. -d file_name ... Delete any embedded trailing option strings in the given files. -x file_name ... Process the files and create a command line string suitable for use by xloadimage. Arguments starting with - are echoed, arguments not starting with - are treated as files and any trailing options strings are echoed followed by the file name. The xloadimage option -name is treated correctly. EXAMPLES
If fred.gif has the wrong aspect ratio, then it might need viewing with the xloadimage options: xloadimage -yzoom 130 fred.gif This option can then be appended to the file by: xlito -c "-yzoom 130" fred.gif and from then on some new versions of xloadimage will get the appropriate options from the image file itself. Old versions of xloadimage can be made to work by using: xloadimage `xlito -x fred.gif` This can be made transparent by using a script containing something like: xloadimage `xlito -x $*` The script could be called xli for instance. The options can be deleted with: xlito -d fred.gif AUTHOR
Graeme Gill Labtam Australia graeme@labtam.oz.au MAINTAINER
smar@reptiles.org COMPATIBILITY WITH IMAGE FILES
Some image files are actually ascii files that are used in other contexts. X Bitmap files are an example. They are formatted as 'C' style #defines and an initialised array of characters, so that they can be included in 'C' source code. Adding trailing options would therefore render the file unusable with a compiler, since it will get a syntax error on the railing option string and the magic numbers. The solution to this is that xlito will ignore a certain amount (a few hundred bytes) after the trailing options, and uses a padding of 20 bytes before the trailing options. These two areas will be maintained when changing an existing trailing option. In the case of an X bitmap then, the solution is to edit the file and place the embedded string in some 'C' comments: eg: say the file starts as: #define tt_width 4 #define tt_height 4 static char tt_bits[] = { 0x08, 0x02, 0x04, 0x01}; and you add a trailing options: #define tt_width 4 #define tt_height 4 static char tt_bits[] = { 0x08, 0x02, 0x04, 0x01}; 01234567890123456789XXX xloadimage trailing options XXX0007"-smooth"0007XXX xloadimage trailing options XXX Then the trailing options can be commented out: #define tt_width 4 #define tt_height 4 static char tt_bits[] = { 0x08, 0x02, 0x04, 0x01}; /*234567890123456789XXX xloadimage trailing options XXX0007"-smooth"0007XXX xloadimage trailing options XXX */ BUGS
xlito doesn't cope with compressed files. A files will need uncompressing, the options added, and then compressing again. 7 Jul 1993 XLITO(1)
All times are GMT -4. The time now is 07:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy