Sponsored Content
Top Forums Shell Programming and Scripting delete lines containing a specific word in afile Post 302289956 by Shahul on Friday 20th of February 2009 11:00:10 PM
Old 02-21-2009
Hi,


sed '/UNIX/d' inputfile > output

or

if you are using variable ...then
sed -e '/'$var'/d' inputfile > output

Thanks
Sha
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how many times a word occur in afile

i want a shell script program for how many times a word occur in a file. i need not the line number but i want the counts of the particular word for eg:- hai how r u.. i am from andhra pradesh.. i am from tenali.i need this answer.i need it urgently.. i hope u will answer this ... ... (9 Replies)
Discussion started by: madhu.it
9 Replies

2. Shell Programming and Scripting

search a word and delete consecutive lines below it

Hi all coders, I need a help to process some data. I have this file, 3 09/21/08 03:32:07 started undef mino Oracle nmx004.wwdc.numonyx.co m Message Text : The Oracle session with the PID 1103 has a CPU time consuming of 999.00... (3 Replies)
Discussion started by: vikas027
3 Replies

3. Shell Programming and Scripting

How to delete all lines before a specific word?

Let's say we have a file containing: alllllsadfsdasdf qwdDDDaassss ccxxcxc#2222 dssSSSSddDDDD D1Sqn2NYOHgTI Hello Alex ssS@3 Ok, and let's say we want to delete all words from D1Sqn2NYOHgTI and back, this means to delete the words (and the lines of them) : alllllsadfsdasdf... (2 Replies)
Discussion started by: hakermania
2 Replies

4. Shell Programming and Scripting

Delete all lines after a specific line ?

Hello. My file is like this: a b c d e f g h i I want to delete all lines after the 3rd line, means after the "c". Is there any way to do this? The lines differ between them and the lines I want to delete does not have a specific word, or the lines I want to keep (a,b,c) does not have a... (4 Replies)
Discussion started by: hakermania
4 Replies

5. Shell Programming and Scripting

A way to delete specific lines

Hi all, I hope an expert tells me that there is a way to get ride of the certain lines in my files which have no specific string on them but fixed length. It's the original pattern:... (9 Replies)
Discussion started by: GoldenFire
9 Replies

6. Shell Programming and Scripting

Search the word to be deleted and delete lines above this word starting from P1 to P3

Hi, I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this: Records P1 10,23423432 ,77:1 ,234:2 P2 10,9089004 ,77:1 ,234:2 ,87:123 ,9898:2 P3 456456 P1 :123,456456546 P2 abc:324234 (2 Replies)
Discussion started by: vsachan
2 Replies

7. UNIX for Dummies Questions & Answers

how to join all lines in afile in unix

Hi, I have a unix file which has many lines, i need to join all the lines to single line. Eg: myfile.txt contains: a 123 45fg try and i need the output as : a 123 45fg try Please help me on this. Thanks! (2 Replies)
Discussion started by: RP09
2 Replies

8. UNIX for Dummies Questions & Answers

Delete lines with a word and their above lines

Hi, i have a file like this: A1 kdfjdljfdkljfdlf A2 lfjdlfkjddkjf A3 ***no hit*** A4 ldjfldjfdk A5 ***no hit*** A6 jldfjdlfjdlkfjd I want to remove the lines "***no hit*** and their above line to get an output file like this: (11 Replies)
Discussion started by: the_simpsons
11 Replies

9. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

10. Shell Programming and Scripting

Find specific lines between two brackets after a word

I have a file whose contents are something like below: node 'sghjknch16' { include vmware include sudo include sssd include hardening include hpom include tidal include tibco-mft-ps include jboss include... (2 Replies)
Discussion started by: proactiveaditya
2 Replies
gdcm2vtk(1)							       GDCM							       gdcm2vtk(1)

NAME
gdcm2vtk - Convert a file supported by VTK into DICOM. SYNOPSIS
gdcm2vtk [options] file-in file-out DESCRIPTION
The gdcm2vtk takes as input any file supported by VTK (including DICOM file) and will generate as output a DICOM file. PARAMETERS
file-in input filename (DICOM or VTK supported) file-out DICOM output filename options options --force-rescale force rescale. --force-spacing force spacing. --palette-color when supported generate a PALETTE COLOR file. --argb when supported generate a ARGB file. --compress when supported generate a compressed file. --use-vtkdicom Use vtkDICOMImageReader (instead of GDCM). --modality set Modality. --lower-left set lower left. --shift set shift. --scale set scale. --compress set compression (MetaIO). -T --study-uid Study UID. -S --series-uid Series UID. --root-uid Root UID. compression options -J --jpeg Compress image in jpeg. -K --j2k Compress image in j2k. -L --jpegls Compress image in jpeg-ls. -R --rle Compress image in rle (lossless only). general options -h --help print this help text and exit -v --version print version information and exit -V --verbose verbose mode (warning+error). -W --warning warning mode, print warning information -E --error error mode, print error information -D --debug debug mode, print debug information environment variable GDCM_ROOT_UID Root UID DESCRIPTION
Convert a file supported by VTK into DICOM. Typical usage is: $ gdcm2vtk inputfile output.dcm It uses the internal factory mechanism of VTK to recognize a file (CanRead function). See VTK supported file here: What image file formats can VTK read and write? http://www.vtk.org/Wiki/VTK_FAQ#What_image_file_formats_can_VTK_read_and_write.3F If your input file has 4 components, the 4th comp (alpha) will be removed from the output file as DICOM does not support alpha component anymore (see --argb option). Special care was taken for the following file format: 1. DICOM: Direction Cosines and vtkMedicalImageInformation are passed to the output 2. BMP: The file can be saved with a Lookup Table (see --palette-color) 3. GE Signa: vtkMedicalImageProperties is passed to the output 4. MINC: Direction Cosines is passed to the output 5. TIFF: vtkTIFFReader is currently in bad shape in VTK (different behavior in VTK 5.2 and CVS). Only use it, if you know what you are doing. CONVERT MetaImage (mhd, mha) $ gdcm2vtk inputfile output.mha This command will convert the input DICOM file: inputfile into a MetaImage .mha file. Same goes for .mhd file. CONVERT MHA/MHD $ gdcm2vtk inputfile output.mha or $ gdcm2vtk inputfile output.mhd This command will convert the input DICOM file: inputfile into a MetaImageData .mha/.mhd file. CONVERT VTI $ gdcm2vtk inputfile output.vti This command will convert the input DICOM file: inputfile into a XML VTK ImageData .vti file. CONVERT VTK $ gdcm2vtk inputfile output.vtk This command will convert the input DICOM file: inputfile into an old VTK Structured PointSets .vtk file. CONVERT DICOM
$ gdcm2vtk input.dcm output.dcm vtkGDCMImageReader will be used to read in a DICOM file, not the default vtkDICOMImageReader. See option --use-vtkdicom to use vtkDICOMImageReader. RoundTrip DICOM to MHD to DICOM $ gdcm2vtk input_ybr.dcm output.mhd $ gdcm2vtk --modality US --imageformat 7 output.mhd output.dcm The above section shows how to convert a DICOM using the Photometric Interpretation of YBR_FULL (or even YBR_FULL_422 is lossy) into another file format: MetaImage (mhd). Since this file format does not handle color space, we have to explicitely set it using the --imageformat command line option. The --modality command line option is required in this case since the default Secondary Capture Image Storage Class family does not allow for YBR Photometric Interpretation. gdcm2vtk notes IMPORTANT NOTE: The internal VTK structured will be filled from the input DICOM, and then pass to the output DICOM writer. Some information might be lost during the conversion DICOM to VTK to DICOM. This option is mostly used to test the vtkGDCMImageReader/vtkGDCMImageWriter combination. IMPORTANT NOTE: When converting from a lossy format such as JPEG, the information of lossiness is important. The output DICOM will contains the required Lossy Image Compression attribute that indicates that image was lossy-compressed somewhere along the pipeline. See also gdcmimg (better handling of JPEG in general). IMPORTANT NOTE: When using --use-vtkdicom the output DICOM file will always be written as MR Image Storage as this information is not available from the reader itself. This allow setting the Image Orientation (Patient) properly. SEE ALSO
gdcmdump(1), gdcmviewer(1), gdcmimg(1) COPYRIGHT
Copyright (c) 2006-2011 Mathieu Malaterre Version 2.2.0 Tue Feb 5 2013 gdcm2vtk(1)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy