Sponsored Content
Top Forums Shell Programming and Scripting append out on particular line number Post 302530819 by learnbash on Wednesday 15th of June 2011 04:22:01 AM
Old 06-15-2011
Quote:
Originally Posted by kumaran_5555
Try this.

Code:
awk '{if(NR==9){system("sed 's/abc/ash/g' test.txt")}else {print}}' final.txt

what about lines after line number 9 ? you want them to printed or not ?
dear sir i dont want to print the line of final.txt, i want that whatever line which we get from sed need to insert under final.txt at line number 9 nothing else.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending line number to each line and getting total number of lines

Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me. I have a file say: abc def ccc ddd ffff The output should be: Instance1=abc Instance2=def Instance3=ccc Instance4=ddd Instance5=ffff ... (2 Replies)
Discussion started by: chiru_h
2 Replies

2. Shell Programming and Scripting

Adding a columnfrom a specifit line number to a specific line number

Hi, I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers. To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies

3. Shell Programming and Scripting

Joining lines in reverse. append line 1 to line 2.

Hi I have used many times the various methods to append two lines together in a file. This time I want to append the 1st line to the second and repeat for the complete file.... an example This is the file owns the big brown dog joe owns the small black dog jim What I want is ... (7 Replies)
Discussion started by: dwalley
7 Replies

4. Shell Programming and Scripting

how to get the data from line number 1 to line number 100 of a file

Hi Everybody, I am trying to write a script that will get some perticuler data from a file and redirect to a file. My Question is, I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line. I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies

5. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

6. Shell Programming and Scripting

Write $line number into textfile and read from line number

Hello everyone, I don't really know anything about scripting, but I have to manage to make this script, out of necessity. #!/bin/bash while read -r line; do #I'm reading from a big wordlist instructions using $line done Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
4 Replies

7. UNIX for Dummies Questions & Answers

How to remove fields space and append next line to previous line.?

awk 'BEGIN{FS = "Ç"} NR == 1 {p = $0; next} NF > 1 {print p; p = $0} NF <= 1 {p = (p " " $0)} END {print p}' input.txt > output.txt This is what the input data file looks like with broken lines Code: 29863 Ç890000000 Ç543209911 ÇCHNGOHG Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies

8. Shell Programming and Scripting

Need append sequence number

Hi, Need to add sequnce number to one of the csv file and please find below actual requirement. Input file ABC,500 XXQ,700 ADF,400, ART,200 Out put file should be 1,ABC,500 2,XXQ,700 3,ADF,400, 4,ART,200 (3 Replies)
Discussion started by: siva83
3 Replies

9. Shell Programming and Scripting

Append by line number

i want to append line 1 of file1 to the beginning of line1 of file2 and keep existing txt i have tried this sed sed -n '1p' file1 >> file2 but that goes to line 2 example file1 looks like this jump file2 should look like this jump over i would to do this by line number as... (10 Replies)
Discussion started by: bob123
10 Replies

10. Shell Programming and Scripting

Remove new line starting with a numeric value and append it to the previous line

Hi, i have a file with multiple entries. After some tests with sed i managed to get the file output as follows: lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1, 00,2110597,2094790,0,81,529,75649011,56435363, lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 Replies
TABLIX(1)						       Tablix User's Manual							 TABLIX(1)

NAME
tablix2_benchmark - Tablix benchmark utility SYNOPSIS
tablix2_benchmark benchmark [ options ] " Tablix options " file DESCRIPTION
Tablix is a powerful free software kernel for solving general timetabling problems. It uses a coarse-grained parallel genetic algorithm in combi- nation with other techniques to construct sensible timetables from XML formatted problem descriptions. Tablix can run on a single host as well as on a heterogeneous parallel virtual machine using PVM3. tablix2_benchmark is used to test the effect of different Tablix command line options on the final result. In most tests Tablix is started multi- ple times with the same input file to provide more reliable results. Each time Tablix is started, three variables are measured: the fitness value of the resulting timetable, serial number of the last generation and elapsed time (in seconds). When a test is finished, the average for each variable, as well as the maximum and minimum values are printed on standard output. The exact format depends on each test. The actual timetables that are generated during these tests are stored under a temporary file names in the current directory and are deleted after tablix2_benchmark exits. In some cases tests can take several days to complete. Because the genetic algorithm can in some cases go into an endless loop, it is always advisable to limit Tablix execution time with the -t option. This way at least the maximum execution time for a test can be calculated. tablix2_benchmark will detect when the time limit set by the -t option was reached. This information will be included in the final statistics. OPTIONS
The following tests are supported: tablix2_benchmark --single ";OPTIONS" file Execute a single Tablix run using and print the results. OPTIONS parameter is mandatory and contains options that will be passed to the tablix2 process. tablix2_benchmark --multiple N ";OPTIONS" FILE Execute N Tablix runs and print the statistics. OPTIONS parameter is mandatory and contains options that will be passed to the tablix2 process. tablix2_benchmark --graph START STEP STOP ";OPTIONS" FILE Execute multiple Tablix runs. The character " N " in OPTIONS is substituted for an integer that is changed from START to STOP by STEP . Output is gnuplot friendly. tablix2_benchmark --multi-graph M START STEP STOP ";OPTIONS" FILE Execute multiple Tablix runs. The character " N " in OPTIONS is substituted for an integer that is changed from START to STOP by STEP . M Tablix runs are executed for each value of N . Output is gnuplot friendly (use errorbars). EXAMPLES
The following test can be for example used to see the minimum grade, that can be reached with this configuration file: tablix2_benchmark --multiple 5 "-t 90 -n 5" sample.xml Tablix will be started five times. Each time with five computing nodes and with 90 minute time limit. tablix2_benchmark can also provide useful data for developers. Following test can be used to check the effect of the number of computing nodes on the total time required to obtain the result: tablix2_benchmark --multi-graph 5 1 1 10 "-t 90 -n N" sample.xml > stats.txt Tablix will be started 50 times. 5 times for each value of N (which in this case means the number of nodes). Ten values of N will be probed: from 1 to 10 with steps of 1. The output will be redirected to stats.txt . A graph of average computing time versus number of nodes can then be pro- duced in gnuplot with the following command: plot "test.txt" using ($1):($8):($9):($10) with yerrorbars BUGS
tablix2_benchmark utility depends on a number of common UNIX programs (mktemp, grep, sed, awk, ...) that may not be available on all systems. The script is not currently capable of properly detecting if any required programs are missing. AUTHOR
Tomaz Solc (tomaz.solc@tablix.org) SEE ALSO
tablix2(1), Tablix User's Manual, Tablix modules HOWTO, Tablix on Morphix HOWTO Tomaz Solc 2005-09-03 TABLIX(1)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy