10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a requirement where I need to add a variable value based on a pattern match. When I try this it works:
sed '/IS_ETL_DEV/a\
ABCD' File1.txt > File1.tmp
Now I want to replace IS _ETL_DEV with a variable like $Pattern and replace the values ABCD with a variable $Var the value "$$XYZ=1".... (4 Replies)
Discussion started by: vskr72
4 Replies
2. UNIX for Dummies Questions & Answers
I have output like this:
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
...
where USER_ID is a unique user login followed by their login timestamp and... (6 Replies)
Discussion started by: MaindotC
6 Replies
3. Shell Programming and Scripting
Hi,
I have a variable... it can take a value from 1 to 99...
now when it is 1 to 9 i want to save it as 01 to 09 in the same variable... can this be done using sed or awk???
a=1
i want it as a=01
Thanks in advance... (8 Replies)
Discussion started by: Nithz
8 Replies
4. UNIX for Dummies Questions & Answers
I want to build an array using awk, consisting only of a subset of lines of a file. I know how to have awk assess whether a key phrase is in a particular line, but I can't find anywhere how to then append the line containing that phrase to an array that has previously-found lines also containing... (9 Replies)
Discussion started by: pts2
9 Replies
5. Shell Programming and Scripting
Hi,
I have the following lines that I would like to see in an array for easy comparisons and printing:
Example 1:
field1,field2,field3,field4,field5
value1,value2,value3,value4,value5Example 2:
field1,field3,field4,field2,field5,field6,field7... (7 Replies)
Discussion started by: ejdv
7 Replies
6. Shell Programming and Scripting
Legends,
Please help me out.
I have a file abc.txt with the following entries
JACK
JIL
SANDY
amer
europe
pak
Now, i want to append the character after each line.
but, condition is if it is UPPER case then character appended should be uppercase, else lowercase
example:
JACKL2... (5 Replies)
Discussion started by: sdosanjh
5 Replies
7. Shell Programming and Scripting
Hi All,
I have a file separated by , and each line end with ".If the line doesnt end with " then i need to join the current line and the next one and put them in another file
a, b, c,d"
d,f,g,h
k, l m"
o,p,q,r,t"
ouput :
a,b,c,d"
d,f,g,h,k,l,m"
o,p,q,r,t" (2 Replies)
Discussion started by: gwrm
2 Replies
8. Shell Programming and Scripting
Hello-
I have a variable which contains a number, I need to populate number of zeros before another value as per this variable value.
for example:
I have variable X whose content is 5, variable Y whose content is 123
Now append number of zeros as per variable X before varible 'Y'... (4 Replies)
Discussion started by: pasupuleti81
4 Replies
9. Shell Programming and Scripting
I have the following data in a file and would like to append the lines inside each section 10, 20, 30, 40, etc... onto one line for each of the sections. Is it possible with SED to make this happen??
10 00039393 DOCK: RECEIVE PART, TAG. D D
... (3 Replies)
Discussion started by: miklacic
3 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
Can someone suggest how to append some word to all lines in file. for example word "Honey" to file f1 with lines:
Mia
Katrin
Elizabeth
to get
Honey Mia
Honey Katrin
Honey Elizabeth
Thanks in advance
Givi (3 Replies)
Discussion started by: giviut
3 Replies