Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Insert text in datafile with uneven columns Post 302383428 by tintin72 on Tuesday 29th of December 2009 05:03:20 PM
Old 12-29-2009
Hi,

I want to insert a pre-defined number, i.e. in this case "-999.99", into all blank rows.

The reason for this is that I want to use the datafile to generate histograms - one for each data column. Problem is the histograms must all have the same number of entries or else my code fails. So I need to insert an arbitrary high number say, 999 or -999 to fill up the blank rows. On generating the histograms I can then select the data I'm interested in using cuts.

Cheers
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combine a datafile with Master datafile, emergent!

Hi guys, my supervisor has asked me to solve the problem in 7 days, I've taken 3 days to think about it but couldn't figure out any idea. Please give me some thoughts with the following problem, I have index.database that has only index date: 1994 1995 1996 1997 1998 1999 I have... (6 Replies)
Discussion started by: onthetopo
6 Replies

2. AIX

How to insert dummy columns

Hi My requirement is as follows, I have a input feed coming for X as A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; any other feed coming from Y is as ... (2 Replies)
Discussion started by: smolgara
2 Replies

3. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

4. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

5. Shell Programming and Scripting

Reversing numbers in a datafile of rows and columns

Hello, I've tried searching the forum for an answer to my question, but without any luck... I have a datafile looking simplified as follows: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 I want to reverse it by rearranging all the numbers from last to... (16 Replies)
Discussion started by: mattings
16 Replies

6. UNIX for Dummies Questions & Answers

How to insert alternative columns and sort text from first column to second?

Hi Everybody, I am just new to UNIX as well as to this forum. I have a text file with 10,000 coloumns and each coloumn contains values separated by space. I want to separate them into new coloumns..the file is something like this as ad af 1 A as ad af 1 D ... ... 1 and A are in one... (7 Replies)
Discussion started by: Unilearn
7 Replies

7. Shell Programming and Scripting

sorting the datafile in an order given in second datafile

Hi, I have two files: first input file is having 7-8 columns, and second data file is like I want to arrange my datafile1 in the order given in second data file, by comparing the seconddatafile with the second column of first file and print the entire line....also if any... (2 Replies)
Discussion started by: CAch
2 Replies

8. UNIX for Dummies Questions & Answers

Removing columns from a text file that do not have any values in second and third columns

I have a text file that has three columns. But at the end of the text file, there are trailing lines that have missing second and third columns: 4 0.04972604 KLHL28 4 0.0497332 CSTB 4 0.04979822 AIF1 4 0.04983331 DECR2 4 0.04990344 KATNB1 4 4 4 4 How can I remove the trailing... (3 Replies)
Discussion started by: evelibertine
3 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Uneven column to row conversion

Hi Unix Forum, I have a relatively easy question i suppose for which, however, until now i could not find a solution. I am working with a program that will give me an output file similar to the following: A 1 2 3 4 B 1 2 3 4 C 1 (9 Replies)
Discussion started by: Leander
9 Replies

10. UNIX for Dummies Questions & Answers

Match and insert columns

Hi, I've got two files to match. File one: a1 b c d e a2 b c d e a3 b c d e a4 b c d e and file 2 a1 1 2 3 4 a2 5 6 7 8 a3 9 10 11 12 a4 1 2 3 4 I need to match them by the first column and add the four columns of file 2 to the file 1 so that those added columns go as columns... (5 Replies)
Discussion started by: zajtat
5 Replies
H2ROOT(1)						      General Commands Manual							 H2ROOT(1)

NAME
h2root - convert PAW HBOOK files to ROOT files SYNOPSIS
h2root file.hbook file.root [compress] [tolower] [lrecl] DESCRIPTION
h2root you can use to convert your HBOOK/PAW histograms or ntuples files into ROOT files. To use this program, you type the shell script command: h2root hbookfile rootfile If you do not specify the second parameter, a file name is automatically generated for you. If hbookfile is of the form file.hbook, then the ROOT file will be called file.root. This program converts HBOOK histograms into ROOT objects of the class TH1F. HBOOK profile histograms are converted into ROOT profile his- tograms (see class TProfile). HBOOK row-wise and column-wise ntuples are automatically converted to ROOT Trees(see TTree). Some HBOOK column-wise ntuples may not be fully converted in case one of the columns is an array with fix dimensions (eg. `var[6]') or is a multi- dimensional array. HBOOK integer identifiers are converted into ROOT named objects by prefixing the integer identifier with the letter `h' if the identifier is a positive integer and by `h_' if it is a negative integer identifier. In case of row-wise or column-wise ntuples, each column is converted to a branch of a Tree. Note that h2root is able to convert HBOOK files containing several levels of sub-directories. Once you have converted your file, you can look at it and draw histograms or process ntuples using the ROOT interactive module. You can also use the ROOT browser (see TBrowser) to inspect this file. The chapter How to read a Tree explains two ways to read a Tree. ROOT includes the function TTree::MakeCode to automatically generate the code for a skeleton analysis function. With OPTIONS
compress = 1 by default (use 0 for no compression) tolower = 1 by default (use 0 to keep case of column names) lrecl = 0 by default (must be specified if >8092) SEE ALSO
root(1), g2root(1) and The ROOT Users Guide available from the main ROOT website: http://root.cern.ch h2root is documented fully on http://root.cern.ch/root/HowtoConvert.html ORIGINAL AUTHORS
The ROOT team (see web page above): Rene Brun and Fons Rademakers COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as pub- lished by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foun- dation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA AUTHOR
This manual page was written by Christian Holm Christensen <cholm@nbi.dk>, for the Debian GNU/Linux system (but may be used by others). ROOT
Version 3 H2ROOT(1)
All times are GMT -4. The time now is 10:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy