10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I would like to use printf (or something else?) to create a line of text that has varying column widths. This will be used to create a fixed width file (with varying column widths). For example, consider variables $1 $2 $3 are equal to a, b, c respectively and they should be printed in column... (10 Replies)
Discussion started by: farrenthorpe
10 Replies
2. Shell Programming and Scripting
Hallo Everyone.
I have to admit I'm shell scripting illiterate . I need to find certain strings in several text files and replace each of the string by unique & corresponding text.
I prepared a csv file with 3 columns: <filename>;<old_pattern>;<new_pattern>
... (5 Replies)
Discussion started by: gordom
5 Replies
3. Shell Programming and Scripting
Hi,
I am new to unix. I need to insert a variable which contains some lines of text into a text file after fixed number of lines..
Please help me on this..
Thanks in Advance,
Amrutha (3 Replies)
Discussion started by: amr89
3 Replies
4. Shell Programming and Scripting
Well, to make another post at this helpful forum :b::D:
I recently tried something like this, I want to replace all those numberings/letters that are located
between <string>file://localhost/var/mobile/Applications/ and /Documents/</string>
numberings =----
replace with:
first... (6 Replies)
Discussion started by: pasc
6 Replies
5. Shell Programming and Scripting
The code below gives the string "test1.txt" even though "tessdsdt" does not match "test1.txt". I would like to return "" if there is no match and return some kind of error that I can capture and decide what to do.
echo test1.txt | awk -v src="tessdsdt" -v dst="test" '{sub(src,dst); print}' (16 Replies)
Discussion started by: kristinu
16 Replies
6. Shell Programming and Scripting
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies
7. Shell Programming and Scripting
I am trying to take the two line version of this:
mv myFile.txt myFile.txt.bak
sed 's/foo/bar/g' myFile.txt.bak > myFile.txt
and make it into a shell script with three parameters. First two parameters are the string and string replacement and the third is file. So far this is what I have... (5 Replies)
Discussion started by: gordonheimer
5 Replies
8. Shell Programming and Scripting
Hi All,
I just need to do find and replace in a file....
say for eg I have the input file like below:
in.txt
#####
oldtextoldtext
oldtext
oldtext
oldtext
oldtext123
oldtext-
oldtext
I need to replace oldtext to newtext... my output file should come like below..
out.txt... (9 Replies)
Discussion started by: askumarece
9 Replies
9. Shell Programming and Scripting
Input file - tmp
<begin>
./00003/
./00004/
<end>
I would like to replace "." with the value of pwd
so that the output will look like
/dev/project/00003/
t=`pwd`
sed -e "s/\./$t/g" tmp > tmp1;
The above piece of code is not working. Appreciate your help. (4 Replies)
Discussion started by: lotto_123
4 Replies
10. Shell Programming and Scripting
Hi,
Im trying to update some properties files with text from another file:
file1
user=xyz
file2
user=
after script
file2
user=xyz
Im using this reading the $QUARTZURL,ETC... from quartz.properties:
echo... (1 Reply)
Discussion started by: mc1392
1 Replies