Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Adding a running sequence number while appending 2 files Post 302468885 by agn on Thursday 4th of November 2010 05:09:02 AM
Old 11-04-2010
Code:
 
$ cat file1 
Tom 
Dick 
Harry 
Charlie 
$ cat file2 
Boston 
Newyork 
LA 
Toledo 
$ paste file{1,2} | cat -n
      1  Tom     Boston
      2  Dick    Newyork
      3  Harry   LA
      4  Charlie Toledo

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

appending variable number of files

In a particular path of a server I have number of files.The files are generated every date with a date_mth stap on this.There are different files for different clients. For example in /data1 path i have X_0416_Score Y_0416_Score Z_0417_Score X_0417_Score A_0417_Score If i will run the... (1 Reply)
Discussion started by: dr46014
1 Replies

2. Shell Programming and Scripting

Adding a sequence number within a file

Can someone please help. I need to add a sequence number to the start of each line of a file. It needs to be 6 characters long. ie 000001 next line starts 000002 etc. (4 Replies)
Discussion started by: Dolph
4 Replies

3. Shell Programming and Scripting

How to split a file with adding sequence number and extension.

I have a file name -HRCFTSIN05PLA1602100430444444 my requirement is to split the file in 10000 count each file and to add sequence number.rch at the end of each file. output should be in this format HRCFTSIN05PLA160210043044444401.rch HRCFTSIN05PLA160210043044444402.rch... (4 Replies)
Discussion started by: abhigrkist
4 Replies

4. UNIX for Dummies Questions & Answers

Adding Sequence Number to file

Hi All, I need to create a script which checks for a particular file for eg.kumar1.txt. If kumar1.txt is already exist the script should increment the file name as kumar2.txt and so on. Please Advise. Thanks & Regards, Kumar66 (2 Replies)
Discussion started by: kumar66
2 Replies

5. Shell Programming and Scripting

Perl : print the sequence number without missing number

Dear Perl users, I need your help to solve my problem below. I want to print the sequence number without missing number within the range. E.g. my sequence number : 1 2 3 4 5 6 7 8 11 12 13 14 my desired output: 1 -8 , 11-14 my code below but still problem with the result: 1 - 14 1 -... (2 Replies)
Discussion started by: mandai
2 Replies

6. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

7. Shell Programming and Scripting

Help with appending random sequence to huge CDR file

Hi, I am in a terrible emergency. I have multiple cdr files with line count >6000. I need to append |0| | | | | | | |random| to end of each line. The random number should never repeat. Please help with a shell script to process all cdr's in a directory with above requirement. (23 Replies)
Discussion started by: shiburnair
23 Replies

8. Shell Programming and Scripting

Need Help in adding sequence number to a file

Hi All , I have a file which contains data(comma separated) in below format : 500,Sourav ,kolkata ,8745775020,700091 505,ram,delhi ,9875645874,600032 510 ,madhu ,mumbai ,5698756430 ,500042 515 ,ramesh ,blore ,8769045601 ,400092 I want to add unique sequence number at the start of each... (7 Replies)
Discussion started by: STCET22
7 Replies

9. Shell Programming and Scripting

Appending sequence number at the end of file name

hi team, i need a script for renaming a file with sequence number. script get a file from one directory'/home/billing/Cmm/sms/sms_tmp' append sequence no at the end of file name and move a file to other directory/home/billing/Cmm/sms/. actual file is cdr201508271527 file after renaming ... (3 Replies)
Discussion started by: mfaizan40
3 Replies

10. Shell Programming and Scripting

Add sequence number to files

Hi I am having files in my dir ,some times it vary ,i need to assign sequence number with gunzip the file name .Please advise ex: file1.gz file1111.gz file11111.gz file1111111.gz expecting out output file_1 file1111_2 file1111111_3 i written this script ,its not working what i... (3 Replies)
Discussion started by: mohan705
3 Replies
XLITO(1)						      General Commands Manual							  XLITO(1)

NAME
xlito - Append/Delete/Show a Trailing Option string in a file. (XLoadImageTrailingOptions) SYNOPSIS
xlito [option] [string] files ... DESCRIPTION
xlito (XLoadImageTrailingOptions) is a utility that provides a file format independent way of marking image files with the appropriate options to display correctly. It does this by appending to a file, a string specified by the user. The string is marked with some magic numbers so that it can be extracted by a program that knows what to look for. Since almost all image files have some sort of image dimen- sion information in the file, the programs that load or manipulate these files generally do not look beyond the point at which they have read the complete image, so trailing information is safely be hidden. If appending this information causes trouble with other utilities, it can simply be deleted. Appropriate version of xloadimage (ie. xli 1.00) will recognise these trailing options at the end of the image files, and will treat the embedded string as if it were a sequence of command line Image Options. Any Global Options will be ignored, and unlike command line image Options, Trailing Options are never propagated to other images. Old versions of xloadimage (3.01 or less) can be made forward compatible by using the -x option to pull the trailing options out of the image files, and put them on the command line where xloadimage can see them. OPTIONS
The default behavior is to display the trailing option strings (if any) of the files on the argument line. The following options change the behavior of xlito: -c option_string file_name ... This adds or changes the embedded string to option_string. The string will have to be quoted if it is composed of more than one word. -d file_name ... Delete any embedded trailing option strings in the given files. -x file_name ... Process the files and create a command line string suitable for use by xloadimage. Arguments starting with - are echoed, arguments not starting with - are treated as files and any trailing options strings are echoed followed by the file name. The xloadimage option -name is treated correctly. EXAMPLES
If fred.gif has the wrong aspect ratio, then it might need viewing with the xloadimage options: xloadimage -yzoom 130 fred.gif This option can then be appended to the file by: xlito -c "-yzoom 130" fred.gif and from then on some new versions of xloadimage will get the appropriate options from the image file itself. Old versions of xloadimage can be made to work by using: xloadimage `xlito -x fred.gif` This can be made transparent by using a script containing something like: xloadimage `xlito -x $*` The script could be called xli for instance. The options can be deleted with: xlito -d fred.gif AUTHOR
Graeme Gill Labtam Australia graeme@labtam.oz.au MAINTAINER
smar@reptiles.org COMPATIBILITY WITH IMAGE FILES
Some image files are actually ascii files that are used in other contexts. X Bitmap files are an example. They are formatted as 'C' style #defines and an initialised array of characters, so that they can be included in 'C' source code. Adding trailing options would therefore render the file unusable with a compiler, since it will get a syntax error on the railing option string and the magic numbers. The solution to this is that xlito will ignore a certain amount (a few hundred bytes) after the trailing options, and uses a padding of 20 bytes before the trailing options. These two areas will be maintained when changing an existing trailing option. In the case of an X bitmap then, the solution is to edit the file and place the embedded string in some 'C' comments: eg: say the file starts as: #define tt_width 4 #define tt_height 4 static char tt_bits[] = { 0x08, 0x02, 0x04, 0x01}; and you add a trailing options: #define tt_width 4 #define tt_height 4 static char tt_bits[] = { 0x08, 0x02, 0x04, 0x01}; 01234567890123456789XXX xloadimage trailing options XXX0007"-smooth"0007XXX xloadimage trailing options XXX Then the trailing options can be commented out: #define tt_width 4 #define tt_height 4 static char tt_bits[] = { 0x08, 0x02, 0x04, 0x01}; /*234567890123456789XXX xloadimage trailing options XXX0007"-smooth"0007XXX xloadimage trailing options XXX */ BUGS
xlito doesn't cope with compressed files. A files will need uncompressing, the options added, and then compressing again. 7 Jul 1993 XLITO(1)
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy