Sponsored Content
Full Discussion: Writing a dummy line!!
Top Forums UNIX for Dummies Questions & Answers Writing a dummy line!! Post 302845255 by krishmaths on Wednesday 21st of August 2013 06:28:27 AM
Old 08-21-2013
Code:
awk '{if("file_"++a==$1) {print} else {while("file_"a!=$1) {print "file_" a++ " 0 0"};print } }'  filename

Shortened version:
Code:
awk '{while("file_"a+1!=$1) {print "file_" a+1 " 0 0";a++} {print;++a}}' filename


Last edited by krishmaths; 08-21-2013 at 07:45 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accepting filename as command line param and writing to it

Hi, Is it possible to accept a filename as command line parameter and then write to that file using command redirection? i tried the below script. outputfile=`echo $1` echo "Writing to file" > 'echo $outputfile' exit $returncode but it isnt working. is there any other way to... (9 Replies)
Discussion started by: silas.john
9 Replies

2. Shell Programming and Scripting

writing into one line

hi i have a file contains data Line timeout: START->SIGNON_REPLY, SIGNON_REPLY->SIGNON, Received SOT req SOT request: SIGNON->SOT_REPLY, SOT_REPLY->DATA_RECEIVE, DATA_RECEIVE->EOD, i need to write into one line , separated by commas please help thanks Satya (2 Replies)
Discussion started by: Satyak
2 Replies

3. Shell Programming and Scripting

Writing line to a file

Hi, I'm reading and writing a line from one file to another. Input line is like this: My name is David. Working on a shell script now. When I use "echo" or "print" output comes like this, My name is David. Working on a shell script now. Sample... (7 Replies)
Discussion started by: dateez
7 Replies

4. Shell Programming and Scripting

writing data in a text file at particular line

I need to write value of variable $version at a particular line in a text file. Line number is determined by another variable &line......I don't know how to do it in shell script ... (2 Replies)
Discussion started by: punitpa
2 Replies

5. Shell Programming and Scripting

writing shell script to find line of invalid characters

Hi, I have to write s script to check an input file for invalid characters. In this script I have to find the exact line of the invalid character. If the input file contain 2 invalid character sat line 10 and 17, the script will show the value 10 and 17. Any help is appreciated. (3 Replies)
Discussion started by: beginner82
3 Replies

6. Shell Programming and Scripting

writing string to specific line

I want to put a text string in file using any method on specific line line number 30 text to be put %this is location /var/www/filename (3 Replies)
Discussion started by: aliahsan81
3 Replies

7. Shell Programming and Scripting

Preserving newlines when writing loops on the command line in bash

Dear All, I have a question that's been difficult to get an answer to. I often write command line loops, e.g. find files, print name, grep for term, apply sed, etc I use both zsh and bash. When I write a loop e.g. for line in `more myfile.txt` > do > echo $line > done but... (2 Replies)
Discussion started by: JohnK1
2 Replies

8. Shell Programming and Scripting

writing in a file's particular column number of every line during runtime

Given a particular line number and a corresponding column number, can i write something in the file during run time? For example x=1 and during runtime i want to write the value of x in column 100 of every line of a given file, then how shud that be done? Thanks (9 Replies)
Discussion started by: arindamlive
9 Replies

9. Shell Programming and Scripting

How do i find the first number in each line and insert dummy string into the missing columns?

Hi, I have one input file with the following content: MY_inpfile.txt Aname1 Cname1 Cname2 1808 5 Aname2 Cname1 1802 47 Bname1 ? 1819 22 Bname2 Cname1 1784 11 Bname3 1817 9 Zname1 Cname1 1805 59 Zname2 Cname1 Cname2 Cname3 1797 27 Every line in my input file have a 4 digit... (5 Replies)
Discussion started by: Szaffy
5 Replies

10. Shell Programming and Scripting

Python DictWriter header - not writing in first line of existing file

Hello I am facing a very unique problem and not able to understand why. I have written a function which will check header of the file. If header is present good else it will write the header on top def writeHeaderOutputCSV(fileName): # See if the file exist already try: ... (0 Replies)
Discussion started by: radioactive9
0 Replies
pymcaroitool(1) 					 PyMca X-Ray Fluorescence Toolkit					   pymcaroitool(1)

NAME
pymcaroitool - PyMca region-of-interest imaging X application SYNOPSIS
pymcaroitool [OPTIONS]... [FILE(S)] DESCRIPTION
Start the graphical user interface of the PyMca X-Ray Fluorescence Toolkit region-of-interest imaging tool. This tool is best suited for handling datasets that can be represented by three-dimensional arrays. Typical cases are stacks of images (first dimension is image number) or 2D maps of 1D spectra (last dimension is spectrum channel number). It allows to display maps of particular regions of the spectra or spectra of a particular region of the map. A system of plugins allow to extend the capabilities of this tool. Plugins for multivariate analysis are already built in. If FILE is given, it will be opened in the program provided its format is supported. EXAMPLES
pymcaroitool Start the program with a file browser to select the input files. pymcaroitool file_0001.edf Tries to open the file named file_0001.edf and all indexed files of the form file_????.edf where ???? is a number. pymcaroitool --imagestack=1 file_0001.edf Tries to open the file named file_0001.edf and all indexed files of the form file_????.edf where ???? is a number as a set of images. pymcaroitool uncompressed_tiff_file_0001.tif Tries to open a series of uncompressed TIFF files as an image stack. pymcaroitool --begin=100 --end=200 --filepattern=file_%05d.edf Start the program loading the single indexed files from file_00100.edf to file_00200.edf pymcaroitool --begin=10,100 --end=20,200 --filepattern=row%d_col%03d.dat Load the double indexed files from row10_col100.dat, row10_col101.dat, ... to row20_col00199.dat, row20_col00200.dat CAVEATS
If files f_000.xxx and f_001.xxx are present in the same directory, the program will always try to load both of them unless a cumbersome way using a file pattern is used. SEE ALSO
HDF5, h5py ESRF
March 2012 pymcaroitool(1)
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy