Sponsored Content
Full Discussion: Script for data formatting
Top Forums Shell Programming and Scripting Script for data formatting Post 302279560 by unknown123 on Friday 23rd of January 2009 05:23:20 AM
Old 01-23-2009
try this:

awk '{$2="";$3="|";print $0 $3}' inputfile
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Formatting Data

i am writing a script that reads in a file and i just want it to print each element on a new line here is my code and the data that i want to read in #!/usr/bin/perl use strict; use CGI qw(:standard); use CGI qw(:cgi); my $data_file = "/tmp/results.txt"; my $configuration; my... (3 Replies)
Discussion started by: nmeliasp
3 Replies

2. Shell Programming and Scripting

Re-formatting of data display

Hi All, I have been trying to re-arrange the below data using AWK or Perl. Can anybody help me ? Thanks in advance. Input: 111 222 333 444 AAA BBB CCC DDD 555 666 777 888 EEE FFF GGG HHH Output: (6 Replies)
Discussion started by: Raynon
6 Replies

3. Shell Programming and Scripting

Formatting Data - CSV

I want to check whether if any column data has any + , - , = prefixed to it then convert it in such a form that in excel its not read as formula. echo "$DATA" | awk 'BEGIN { OFS="," } -F" " {print $1,$2,$3,$4,$5,$6,$7,$8.$9,$10,$11,$12}' (4 Replies)
Discussion started by: dinjo_jo
4 Replies

4. Shell Programming and Scripting

Formatting input data

Hello everybody, I have a file containing some statistics regarding CPU usage. The file has this syntax : Fri Jul 16 14:27:16 EEST 2010 Cpu(s): 15.2%us, 1.4%sy, 0.0%ni, 82.3%id, 0.1%wa, 0.0%hi, 0.9%si, 0.0%st Fri Jul 16 15:02:17 EEST 2010 Cpu(s): 15.3%us, 1.4%sy, 0.0%ni, 82.3%id, ... (9 Replies)
Discussion started by: spiriad
9 Replies

5. Shell Programming and Scripting

help with data formatting

Hi, I have data coming in like below. Not all data is like that, these are the problem records that is causing the ETL load to fail. Can you pls help me with combining theese broken records! 001800018000000guyMMAAY~acct name~acct type~~"address part 1 address... (8 Replies)
Discussion started by: varman
8 Replies

6. UNIX for Advanced & Expert Users

formatting the data

HI I want to make it single row if start with braces i.e. { .Any idea {1:XXX2460275191}{2:SEC00687921131112201641N}{3:{58910}}{4: :R:GENL :C::xx//xx1 :20C::yy//yy1 :2S:xxT} {1:XXX2460275190}{2:SEC00687921131112201641y}{3:{58911}}{4: :z:GENL :v::xx//xx1 :10C::yy//yy1 :4S:xxT ... (2 Replies)
Discussion started by: mohan705
2 Replies

7. Shell Programming and Scripting

AWK/Shell script for formatting data in a file

Hi All, Need an urgent help to convert a unix file in to a particular format: **source file:** 1111111 2d2f2h2 3dfgsd3 ........... 1111111 <-- repeats in every nth line. remaining all lines will be different 123ss41 432ff45 ........... 1111111 <-- repetition qwe1234 123weq3... (1 Reply)
Discussion started by: rajivnairfis
1 Replies

8. Shell Programming and Scripting

Help with data formatting

Hi, I am generating the following output from my script. Country,A,B,C,D,E,F INDIA ,3755019,774604,484749,329838,7333612,442031 CHINA ,3716520,889197,530899,379754,6198475,355768 JAPAN ,52038,30462,231224,147275,1272,498 USA,9494,1130,0,0,15303,451... (5 Replies)
Discussion started by: karumudi7
5 Replies

9. Shell Programming and Scripting

Data formatting using awk

Need assistance on the data extraction using awk Below is the format and would like to extract the data in another format ------------------------------------------------------------------------------------------------- Minimum Temperature (deg F ) DAY 1 2 3 4 5 6 7 8 9 10 11... (4 Replies)
Discussion started by: ajayram_arya
4 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 02:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy