Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Replace string and create new file multiple times Post 302974082 by pseudo.seppuku on Wednesday 25th of May 2016 01:11:09 PM
Old 05-25-2016
Thank you! That certainly did the trick. The only caveat is that the new file is called list001.txt01 instead of list002.txt.

Aside from the file-naming convention... is there a way to do this multiple times in a row, using a single script? In other words, i = i + (1..299) - each time saved as a new file?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append some text to a file multiple times

Hi, I have a text file like Version=abc Tab=1 URL GOTO=www.abc.com/board=1 some text... I want to run a loop x no of times and append to the text file above text but URL GOTO should be www.abc.com/board=2 then 3,4...etc till x. Kindly help (2 Replies)
Discussion started by: krabu
2 Replies

2. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

3. Shell Programming and Scripting

replace a string with contents of a txt file containing multiple lines of strings

Hello everyone, ive been trying to replace a string "kw01" in an xml file with the contents of a txt file having multiple lines. im a unix newbie and all the sed combinations i tried resulted to being garbled. Below is the contents of the txt file: RAISEDATTIME --------------------... (13 Replies)
Discussion started by: 4dirk1
13 Replies

4. UNIX for Dummies Questions & Answers

Find string multiple times, same line

Hi everybody, Fairly simple question here: I need an awk, sed, or grep command that will find the same string multiple times on one line needs to return all lines which contain .02 twice. I do know the exact number of characters in between the two occurrences of .02 if that helps, all... (7 Replies)
Discussion started by: jgrosecl
7 Replies

5. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

6. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

7. UNIX for Dummies Questions & Answers

How to check if the same file exists multiple times?

Hi Team , Is there a way I can check to see if the same file say , test.dat exists multiple times in the directory path ? Please help. Thanks Megha (5 Replies)
Discussion started by: megha2525
5 Replies

8. Shell Programming and Scripting

Sed replace using same pattern repeating multiple times in a line

Sed replace using same pattern repeating multiple times in a line I have text like below in a file: I am trying to replace the above line to following How can I acheive this? I am able to do it if the occurrence is for 1 time: But If I try like below I am getting like this: I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies

9. UNIX for Advanced & Expert Users

Wanted to replace string in an .xlsx file in multiple ZIP Files

Hi , I am having a ZIP file containing an .xlsx file . Now i wanted to replace "GJ" to blank in the .xlsx file . I tried using the below code but not working , Please guide : #!/bin/bash log="/home/srikant/scripts/replacescriptFHO.log" date > $log echo "" >> $log echo initiating for FHO... (1 Reply)
Discussion started by: vipinmaster
1 Replies

10. Shell Programming and Scripting

sed command to replace one value which occurs multiple times

Hi, My Input File : "MN.1.2.1.2.14.1.1" := "MN_13_TM_4" ( 000000110110100100110001111110110110101110101001100111110100011010110111001 ) "MOS.1.2.1.2.13.6.2" := "MOS_13_TM_4" ( 000000110110100100110001111110110110101110101001100111110100011010110111001 ) Like above template,I have... (4 Replies)
Discussion started by: Preeti Chandra
4 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 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy