10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two files blocks.txt and rules.txt. In blocks.txt i have the following entries
Linux1
Linux2
Linux3
.....
Linux10
In rules.txt i have the lines where a filename pattern starts like
'blk-name.*'
I want to replace 'blk-name' with the names read from blocks.txt file
I tried... (2 Replies)
Discussion started by: Jag02
2 Replies
2. Shell Programming and Scripting
Hello Forum.
I have a file called abc.sed with the following commands;
s/1/one/g
s/2/two/g
...
I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat
sed -f abc.sed abc.dat >... (10 Replies)
Discussion started by: pchang
10 Replies
3. Shell Programming and Scripting
Hi,
I need help with this-
input.txt :
L B white
X Y white
A B brown
M Y black
Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt.
If 3rd column is brown, add different set of lines to insert.txt, and so on.
For example, the given... (6 Replies)
Discussion started by: prashob123
6 Replies
4. Shell Programming and Scripting
Hello ,
I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file.
Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 Replies
5. Shell Programming and Scripting
Hi All,
I am trying to find 4 latest files inside one folder having following File Name pattern and store them into 4 different variables and then use for processing in my shell script. File name is fixed length.
1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number... (6 Replies)
Discussion started by: lancesunny
6 Replies
6. UNIX for Dummies Questions & Answers
I would need a command for finding first 15000 of the file names whose 25th postion is 5 in the current directory alone.
I do have this painful command
find . -name '5*' | head -15000 | cut -c3-
please refine this.
Of course the above command also searches in the sub directories... (3 Replies)
Discussion started by: vk39221
3 Replies
7. Shell Programming and Scripting
Hi All,
I have a file, let's call it "info.tmp" that contains data like this ..
ABC123456
PCX333445
BCD789833
I need to read "info.tmp" and for each line add strings in a way that the final output is
put /logs/ua/dummy.trigger 'AAA00001.FTP.XXX.BLA03A01.xxxxxx(+1)'
where XXX... (5 Replies)
Discussion started by: Andy_ARG
5 Replies
8. Shell Programming and Scripting
Hi ,
I have a requirement where i have this file
abcd
$$xyz=123
$$zef=789
$$mno=123
$$pqr=456
I need to replace $$pqr from 456 to a new value which will be present in a variable to me.
I am not aware of sed and awk functionality.
Can somebody please show me how to replace this... (6 Replies)
Discussion started by: lifzgud
6 Replies
9. Shell Programming and Scripting
Hi! Everyone,
Say this file1
--------------
line 1 51610183 420001010 0010CTCTLEDPPOO 2151610183
line 2 2151610183 420001010 0030A2TH2
line 3 2151610183 420001010 0040A2TH3
line 4 2151610183 420001010 ... (0 Replies)
Discussion started by: kinkar_ghosh
0 Replies
10. Shell Programming and Scripting
Hi all
i have a file like
2006,1,2
2007,2,3
2008,3,4
I will read this and my output should be like
2006,1,2
2007,1,2
2008,1,2
2007,2,3
2008,2,3
2008,3,4
Giving the explanation, we will read the first line of the file and if the year any other than current year, we will print as many... (1 Reply)
Discussion started by: vasuarjula
1 Replies