Sponsored Content
Top Forums Shell Programming and Scripting Append file name to the beginning of each line Post 302725911 by rakesh5300 on Friday 2nd of November 2012 08:58:34 PM
Old 11-02-2012
Thanks bipinajith ,your code solved my requirement.

Code:
zcat ${file} | awk -v fname=${file} '{print fname "|" $0}'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append (cat) to beginning of file ?

Hi, Fairly new to unix scripting, hoping to get some help. using AIX v5 Basically I have 3 files 1). Header record 2). many detail record 3). Trailer record My desired result is 1 file which contains Heaeder, Detail, Trailer Currenty I am using a series of: ... (8 Replies)
Discussion started by: CBZ
8 Replies

2. UNIX for Dummies Questions & Answers

Append to beginning of a file

Hi, I have a file x which is being upated continuously. I want to add file y in the file x but at the beginning of file x. file x file y After commands file x eeee aaaa aaaa gggg bbbb bbbb hhhh... (2 Replies)
Discussion started by: baanprog
2 Replies

3. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

4. UNIX for Dummies Questions & Answers

Adding one string at the beginning of each line in a file

Hi, I have file a.txt as below. I want to add one string root beginning of each line. Sample file a.txt aaa bbb ccc Sample output Root aaa Root bbb Root ccc Can any one help me on this? (6 Replies)
Discussion started by: siba.s.nayak
6 Replies

5. UNIX for Dummies Questions & Answers

Count Number Of lines in text files and append values to beginning of file

Hello, I have 50 text files in a directory called "AllFiles" I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and... (7 Replies)
Discussion started by: motoxeryz125
7 Replies

6. Shell Programming and Scripting

Append variable texts to the beginning of each line in all files in a directory

I am writing a code to append some numbers in the beginning of each line in all the files present in a directory. The number of files are really huge. The files are numbered as 1.sco, 2.sco, 4.sco (Note: 3.sco is missing). The files currently look like this: 1.sco 2 3 5 6 6 7My task is to... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies

7. Shell Programming and Scripting

Append Multiple files with file name in the beginning of line

Hi, I have multiple files having many lines like as bvelow: file Name a.txt abc def def xyz 123 5678 file Name b.txt abc def def xyz 123 5678 I would like to append files in the below format to a new file: file Name c.txt (7 Replies)
Discussion started by: rramkrishnas
7 Replies

8. Shell Programming and Scripting

Add new line at beginning and end of a file

Hi, I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|". I am looking for some command/option to join these two in single command parameter. ... (6 Replies)
Discussion started by: bhupinder08
6 Replies

9. Shell Programming and Scripting

How to add one line in the beginning of the file?

Hi gurus, I need add one new line in the begining of current file. current file abc cde add xyz output file newline abc cde add xyz (6 Replies)
Discussion started by: ken6503
6 Replies

10. Shell Programming and Scripting

How to append in the beginning not at the end?

Hi, I now that >> will append text to the end of the text that is already inside the file. How to append the new text infront of the text that is already in the file. Thanks for any input. Regards, Chandu (3 Replies)
Discussion started by: chandrakanth
3 Replies
clm imac(1)							  USER COMMANDS 						       clm imac(1)

  NAME
      clm imac - Interpret Matrices (c.q. MCL iterands output by mcl) As Clusterings.

      clmimac  is not in actual fact a program. This manual page documents the behaviour and options of the clm program when invoked in mode imac.
      The options -h, --apropos, --version, -set, --nop are accessible in all clm modes. They are described in the clm manual page.

  SYNOPSIS
      clm imac -imx <fname> [options]

      clm imac -imx fname (input file) [-o fname (name/stem for output)] [-dag fname (output  DAG)]  [-overlap	str  (overlap  mode)]  [-sort  str
      (size|revsize|lex|none)]	[-strict  num (in 0..1)] [-h (print synopsis, exit)] [--apropos (print synopsis, exit)] [--version (print version,
      exit)]

  DESCRIPTION
      Use clm imac to interpret matrices (as clusterings) output by mcl using mcl's -dump ite option.

      Use clm imac only if you have a special reason; the normal usage of mcl is to do multiple runs for varying -I parameters and use	the  clus-
      terings output by mcl itself.  One reason is if you are interested in clusterings with overlap; early MCL iterands generally induce cluster-
      ings possessing overlap.	Another reason is to investigate how the cluster structure associated with the MCL process evolves over time.

  OPTIONS
      -imx fname (input file)
	The input file is presumably an MCL iterand resulting from the mcl option -dump ite.

      -strict num (in 0..1)
	Higher values (up until 1) will thin out the DAG constructed by clm imac. The default value is 0.00001, yielding the full DAG.

      -o fname (file name/stem)
	Write to file named fname.

      -dag fname (output DAG)
	Write the DAG (directed acyclic graph) constructed from the input to file. This DAG is constructed according to the  structure	associated
	with  diagonally positive semi-definite matrices as described in the PhD thesis Graph clustering by flow simulation.  Consult mclfamily(7)
	for references.

      -sort str (size|revsize|lex|none)
	Sort the clusters either by increasing size, decreasing size, lexicographically by the indices they contain, or use the clustering exactly
	as obtained from the interpretation routine.

      -overlap mode (overlap mode)
	With  mode  set  to  cut,  remove  any overlap by allocating the nodes in overlap to the first cluster in which they were found. Mode keep
	leaves overlap unchanged, and mode split results in overlapping parts excised and introduced as clusters in their own right.

  AUTHOR
      Stijn van Dongen.

  SEE ALSO
      mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  clm imac 12-068						      8 Mar 2012							 clm imac(1)
All times are GMT -4. The time now is 04:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy