Hi,
I have a EDI data file ARROWTEST of size 18246 characters. And I want to insert some data after 4200 position in the file. How I can find the position 4200 in that file....Please advise.
Regards, (5 Replies)
Hi All,
I have a flat file with ~ as de-limiter (e.g: aaa~ba a~caa~0~d~e)
What I want is check if the 4th character is 0 and replace it with say 4. So now it becomes : aaa~ba a~caa~4~d~e.
I have to do this for the whole file, but the delimiter position remains the same, not the... (10 Replies)
Hello,
It has been a long time since I have written unix code and I need to insert a variable into the first position of each line in a file. Below is an example of the script and the desired output file
Here is my short script
server="$(hostname)"
df -kg | awk '{print $1, $2, $3, $4,... (3 Replies)
Hi,
I need to add Pipe (|) at 5th and 18th position of all records a file. How can I do this?
I tried to add it at 5th position using the below code. It didnt work. Please help!!!
awk '{substr($0,5,1) ~ /|/}{print}' $input_file > $temp_file (1 Reply)
I want to insert space in 7th position of all the lines usign vi editor or sed command
Input file
12345689010
abcdefghijk
.
.
Output file
123456 89010
abcdef ghijk
.
. (7 Replies)
I have a DNA file like below and I am able to write a short program which finds/not an input motif, but I dont understand how I can include in the code to report which position the motif was found. Example I want to find the first or all "GAT" motifs and want the program to report which position... (12 Replies)
Hi ,
I have a file which has line similar to below
13123324234234234234234234234234234
3454546456dfhgfhgh454645654asdasfsdsddfgdgdfg
345345345mnmnbmnb346mnb4565464564564645645
Not for each line for specific position I need to insert some '|'
Positions are fixed. Like 3,5,9,11
So the... (5 Replies)
Hi All,
how to insert a '#' in the first position of all the files based on a certain condition.
I tried this:
cat /bin/user/input_file.txt | while read a
do
b=`sed 's/.*song=good.*/\#&/g' $a `
echo $b > /bin/user/new/output_file.txt
done
input_file.txt has list of names of 10... (5 Replies)
Thanks to help from Don Cragun in post 302924174, I'm off and getting into trouble on my own (finally) with sed.
Here is my goal - insert \\r\n at the 60th character on each line and then every 76th character thereafter:
Input:... (3 Replies)
I am using bash in Fedora 30
From the below lines (ls -l output), how can I print whatever is between the strings 'status_' and '.log'
$ ls -l | grep -i status
-rw-rw-r--. 1 sysadmin sysadmin 378530 Nov 11 21:58 status_vsbm1.log
-rw-rw-r--. 1 sysadmin sysadmin 428776 Nov 11 21:58... (8 Replies)
Discussion started by: kraljic
8 Replies
LEARN ABOUT LINUX
shtool-subst
SHTOOL-SUBST.TMP(1) GNU Portable Shell Tool SHTOOL-SUBST.TMP(1)NAME
shtool-subst - GNU shtool sed(1) substitution operations
SYNOPSIS
shtool subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ext]
[-e|--exec cmd] [-f|--file cmd-file] [file] [file ...]
DESCRIPTION
This command applies one or more sed(1) substitution operations to stdin or any number of files.
OPTIONS
The following command line options are available.
-v, --verbose
Display some processing information.
-t, --trace
Enable the output of the essential shell commands which are executed.
-n, --nop
No operation mode. Actual execution of the essential shell commands which would be executed is suppressed.
-w, --warning
Show warning on substitution operation resulting in no content change on every file. The default is to show a warning on substitution
operations resulted in no content change on all files.
-q, --quiet
Suppress warning on substitution operation resulting in no content change.
-s, --stealth
Stealth operation. Preserve timestamp on file.
-i, --interactive
Enter interactive mode where the user has to approve each operation.
-b, --backup ext
Preserve backup of original file using file name extension ext. Default is to overwrite the original file.
-e, --exec cmd
Specify sed(1) command directly.
-f, --file cmd-file
Read sed(1) command from file.
EXAMPLE
# shell script
shtool subst -i -e 's;(c) ([0-9]*)-2000;(c) 1-2001;' *.[ch]
# RPM spec-file
%install
shtool subst -v -n
-e 's;^(prefix=).*;1 $RPM_BUILD_ROOT%{_prefix};g'
-e 's;^(sysconfdir=).*;1 $RPM_BUILD_ROOT%{_prefix}/etc;g'
`find . -name Makefile -print`
make install
HISTORY
The GNU shtool subst command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. It was prompted
by the need to have a uniform and convenient patching frontend to sed(1) operations in the OpenPKG package specifications.
SEE ALSO shtool(1), sed(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-SUBST.TMP(1)