Sponsored Content
Top Forums Shell Programming and Scripting Removing empty lines(space) between two lines containing strings Post 302321878 by joeyg on Tuesday 2nd of June 2009 09:56:18 AM
Old 06-02-2009
Hammer & Screwdriver Here is one way

Code:
> cat file22
A1/EXT "BAP_BSC6/07B/00" 844 090602 1605 
RXOCF-465 PDTR11 1

SITE ON BATTERY 

A2/EXT "BAP_BSC6/07B/00" 418 090529 1059 
RXOCF-150 GDP002 2

DOOR OPEN 
A2/EXT "BAP_BSC6/07B/00" 874 090529 1346 
RXOCF-401 BBN001 2

SITE ON BATTERY

> grep "[A-Z0-9]" file22
A1/EXT "BAP_BSC6/07B/00" 844 090602 1605 
RXOCF-465 PDTR11 1
SITE ON BATTERY 
A2/EXT "BAP_BSC6/07B/00" 418 090529 1059 
RXOCF-150 GDP002 2
DOOR OPEN 
A2/EXT "BAP_BSC6/07B/00" 874 090529 1346 
RXOCF-401 BBN001 2
SITE ON BATTERY

And that command can redirect output to a new file, such as
Code:
grep "[A-Z0-9]" file22 > file22a

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

re: removing trailing space from lines

Not sure why this thread was closed without any explanation, but you can do what you're asking with sed 's/]*$//g' < sourceFile > destFile (1 Reply)
Discussion started by: oombera
1 Replies

2. Shell Programming and Scripting

Find lines with space between strings

Hello all, I am having trouble with setting up a regular expression used with egrep. My script reads an input file a line at a time. I would like the egrep command to search for the following pattern: server name at the beginning of the line, then one or more spaces, and then a pound sign. ... (5 Replies)
Discussion started by: Galt
5 Replies

3. Shell Programming and Scripting

using AWK see the upper lines and lower lines of the strings??

Hi experts, You cool guys already given me the awk script below- awk '/9366109380/,printed==5 { ++printed; print; }' 2008-09-14.0.log Morever, i have one more things- when i awk 9366109380, i can also see the Upper 3 lines as well as below 5 lines of that string. Line 1.... (3 Replies)
Discussion started by: thepurple
3 Replies

4. Shell Programming and Scripting

Grep and delete lines except the lines with strings

Hi I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings. Ex: file name 'test' test: approved package waiting for approval package disapproved package removed package approved... (14 Replies)
Discussion started by: vj8436
14 Replies

5. 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

6. Shell Programming and Scripting

Break lines up into single lines after each space in every line

It sounds a bit confusing but what I have is a text file like the example below (without the Line1, Line2, Line3 etc. of course) and I want to move every group of characters into a new line after each space. Example of text file; line1 .digg-widget-theme2 ul { background: rgb(0, 0, 0) none... (7 Replies)
Discussion started by: lewk
7 Replies

7. Shell Programming and Scripting

Extract lines between 2 strings add white space

I'm trying to extract all the lines between 2 strings (including the lines containing the strings) To make the strings unique I need to include white space if possible. I'm not certain how to do that. sed -n '/ string1 /,/string2/p' infile > outfile & (4 Replies)
Discussion started by: dcfargo
4 Replies

8. UNIX for Dummies Questions & Answers

Removing empty lines at the end of a Tab-delimited file

I'm trying to remove all of the empty lines at the end of a Tab delimited file. They have no data just tabs. I've tried may things, here are a couple: sed /^\t.\t/d File1 > File2 sed /^\t{44}/d File1 > File2 What am I missing? (9 Replies)
Discussion started by: SirHenry1
9 Replies

9. Shell Programming and Scripting

Joining broken lines and removing empty lines

Hi - I have req to join broken lines and remove empty lines but should NOT be in one line. It has to be as is line by line. The challenge here is there is no end of line/start of line char. thanks in advance Source:- 2003-04-34024|04-10-2003|Claims|Claim|01-13-2003|Air Bag:Driver;... (7 Replies)
Discussion started by: Jackceasar123
7 Replies

10. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
GPIV_IMG2GPIV(1)					      General Commands Manual						  GPIV_IMG2GPIV(1)

NAME
gpiv_img2gpiv - Converts images into raw data (extension .r) format with the belonging ASCII header file (extension .h) or into the hdf format (extension .hdf). SYNOPSIS
gpiv_img2gpiv [-x | --cross] [-c | --cols ncolumns] [--combine] [-h | --help] [-hdf] [--suf_a EXT] [--suf_b EXT] [--suf_num N] [-i | --inverse] [-n] [-p] [-r | --rows nrows] [-t] [-v | --version] file_base_name DESCRIPTION
gpiv_img2gpiv converts images from a common image format (gif, tif etc) into a raw data image with extension .r. Additionally, it generates an ASCII header file (extension .h). This header contains information concerning image dimensions, color depth, single or double image (for auto or cross-correlation), time and spatial scales, position of pixel# (0, 0) in the experiment and some additional (non-required) parame- ters. gpiv_img2gpiv may also convert to hdf formatted images, with extension .hdf, that might be used by gpiv. This program does not use the parameter resources from libgpiv. The default settings may be overruled by the command line options, as explained below. Options -c | --cols ncolumns The number of columns of the image (default 1280). --combine If the images have been obtained separately, but will have to be used for cross-correlation, they will be combined to a single image file for interrogating with gpiv_rr (or gpiv). See also --suf_a/b and --suf_num. -h | --help On-line help. -hdf Converts to (or from) hdf formatted data (extension .hdf). -i | --inverse Inverse conversion; from raw 8-bit data to image format. --suf_a EXT In combination with --combine: the file_base_name of the first frame to be combined is extended with suffix EXT (default: _a). --suf_b EXT In combination with --combine: the file_base_name of the second frame to be combined is extended with suffix EXT (default: _b). --suf_num N In combination with --combine: If images are numbered instead of with --suf_a and --suf_b. N represents the first of the two num- bered frames which will be combined with frame N + 1. The combined image will be named to file_base_nameN.r. So, only odd or even numbered images will result to be loaded in gpiv_rr (or gpiv) for cross-correlation. -n No execute, only print processes. -p Prints process to stdout. -r | --rows nrows The number of rows in the frame of a SINGLE image (default 1024). An image frame containing a PIV pair of images (to be used for cross-correlation) should have the double amount of rows; from row #0 to row #nrows - 1 contains the first image and from row #nrows to row #2xnrows - 1 contains the second image. -t Image type or format (default bmp). -v | --version Print version information on standard output, then exit successfully. -x | --cross Double image for cross-correlation (default: single image for auto-correlation). SEE ALSO
gpivtools NOTES
The program uses convert. AUTHOR
Gerber Van der Graaf 19 Januari 2005 GPIV_IMG2GPIV(1)
All times are GMT -4. The time now is 09:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy