Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Replace string and create new file multiple times Post 302974078 by pseudo.seppuku on Wednesday 25th of May 2016 12:45:37 PM
Old 05-25-2016
Each line corresponds to an individual command for a program designed to compare two different files (e.g. 001/blah1, 001/blah2, 001/blah3, etc.). I can't stray from the basic format described in my first post or carry out multiple comparisons using a single command. Given that I have a few hundred files to compare, I'm looking for a quicker way to generate this list of commands.

I'll join all 300 files together later on using cat, but at this stage, I figured it might be easier (from a scripting standpoint) to create a new file after each replacement, rather than continually append a set of modified lines to the end of one very long 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
FAX(1)							      General Commands Manual							    FAX(1)

NAME
fax - make, send, receive, view or print a fax SYNOPSIS
fax help fax make [-l] file fax send [-l] [-v] { -m | number } filename... fax [ receive [-v] [ filename-prefix ] ] fax { print | view | rm } filename... fax { queue | status [t] | start | stop } fax answer OPTIONS
-l use low (96 line per inch) resolution -v display verbose messages for debugging -m the phone call has already been dialed manually The commands make, send, receive, view and queue may be abbreviated to their first characters (e.g. ``fax q''). Assignments of the form VARIABLE=value may appear before the command name to temporarily change the values of most fax script variables (e.g. ``fax PAGE=a4 print letter.001'') DESCRIPTION
fax provides a simple user interface to the efax(1) and efix(1) programs. It allows you to send text or Postscript files as faxes and receive, print or preview received faxes. The fax help command prints a summary of the possible commands. To send a fax, the original files need to be converted from ASCII or Postscript into a particular bit-map format (TIFF with Group 3 encod- ing). This can be done automatically by the fax send command or you can use the fax make command to do the conversion before sending the fax. The conversion will create one file per page. These files will have the name of the original file with the page number as an addi- tional suffix. For example, running fax make doc.ps on the two-page postscript file doc.ps would generate the files doc.ps.001 and doc.ps.002. When sending a fax with the fax send command you may dial the number manually and use the -m option or you may give the phone number on the command line. The names of the files to be sent are given on the command line, usually by using wildcards. For example, to send a multi- page fax consisting of the files doc.ps.001, doc.ps.002, and so on, you could use the command fax send 555-1212 doc.ps.0* (if you had already run the fax make command) or simply fax send 555-1212 doc.ps. If the number is busy the script will wait and try again. Use the fax receive command to answer the phone and receive a fax. If a file name is specified the received fax will be stored in files with the given file name plus an extension equal to the page number. If no options are given, the received fax will be stored in files having a name given by the date and time and an extension equal to the page number. For example, a fax received beginning on July 4 at 3:05:20 pm will generate files 0704150520.001, 0704150520.002, and so on. The fax print, fax view, and fax rm commands are used to print, preview or remove received fax files. As with the send command the file names are usually given using wildcards. If efax has been installed for automatic fax reception you can use the fax queue command to check for files in the incoming spool direc- tory. The fax script can also be configured to print received faxes or e-mail them as MIME attachments with type image/tiff-f. For conve- nience the fax print, view and rm commands will first check for the named files in this spool directory. The fax status command shows the status of the automatic receive process once, or every t seconds. Privileged users can use the fax stop and fax start commands to stop and restart the fax reception daemon. The fax answer command is used for unattended reception of faxes. It is normally placed in the inittab(5) or ttytab(5) file and is run automatically by init(8). The -v option displays verbose messages. Other features of the fax script are documented within the script: - a directory that lets you specify recipients by name instead of number - the fax new command to create a simple cover page and start up a text editor - the fax makefont command converts a Postscript font to a bit-mapped font for use in headers or text RESOLUTION
Faxes can be created at low (98 lines per inch) or high (196 lpi) resolution. Almost all fax machines will operate at either resolution. By default files are created at high resolution but you can use the optional -l argument to create files at low resolution. SESSION LOGS
The modem commands and responses together with status and error messages are written to file. If the fax is successfully sent or received the log file is removed. Otherwise a message is printed showing the log file name. Please send a copy of this file when reporting prob- lems with efax. FILES
The fax script will `source' the optional shell scripts /etc/efax.rc, ~/.efaxrc and/or ./.efaxrc before processing command-line arguments. These files can be used to set script variables to custom values for a particular system, user and/or directory. The following files are created in the FAXDIR spool directory when automatic fax reception is enabled (see the fax script). DEV represents the name of the fax modem device file in /dev (e.g. cua1 for /dev/cua1). DEV.n the log file created by the fax answer daemon with process id n DEV.log contains collected log files for device DEV. Log files showing a termination status of 1 (device busy) or 4 (no response from modem) are not added to this file. DEV.stop created by the fax stop command to prevent the fax daemon from starting up. AUTHOR
Fax was written by Ed Casas. Please send comments or bug reports to edc@cce.com. Please describe the type of modem used and include a copy of the log file. COPYRIGHT
Fax is copyright 1993 -- 1999 by Ed Casas. It may be used, copied and modified under the terms of the GNU Public License. DISCLAIMER
Although fax has been tested, it may have errors that will prevent it from working correctly on your system. Some of these errors may cause serious problems including loss of data and interruptions to telephone service. SEE ALSO
efax(1), efix(1), ghostscript(1). BUGS
See efax(1). 3rd Berkeley Distribution May 1996 FAX(1)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy