Search Results

Search: Posts Made By: gotamp
534
Posted By vgersh99
how about - assuming the is sorted temporally and...
how about - assuming the is sorted temporally and the to/from recods are present in the file...

awk -v f='05/21/18' -v t='05/23/18' '$1==f,$1==t' myFile
4,067
Posted By MadeInGermany
In more complex expressions, where everything in...
In more complex expressions, where everything in quotes is too cumbersome, the shell variable references should be in quotes nevertheless (where the quotes must appear in the shell context, so the...
4,067
Posted By RudiC
Your samples in post#5 show a TOTALLY different...
Your samples in post#5 show a TOTALLY different picture that you have in post#1!

Within single quotes, the shell does NOT expand variables, so sed 's/$a/$b/g' tries to replace the string constant...
4,067
Posted By RavinderSingh13
Hello gotamp, You are passing variables to...
Hello gotamp,

You are passing variables to the script, so could you please try following(haven't tested though).

/usr/bin/sed 's/'${a}'/'${b}'/g' /user/iomaint/tempo/gtm/sed/filetosedreplace...
4,067
Posted By RavinderSingh13
Hello gotamp, If I am seeing it correctly...
Hello gotamp,

If I am seeing it correctly you have space in between #! and /bin/ksh in your shebang, try without the space as #!/bin/ksh and let me know how it goes then.

Thanks,
R. Singh
832
Posted By RudiC
Seems like alternation doesn't work on your...
Seems like alternation doesn't work on your solaris sed. Try

echo "<value>WEB_USER</value>" | sed 's/<value>//;s/<\/value>//'
WEB_USER
832
Posted By RavinderSingh13
Hello mohtashims, Could you please try...
Hello mohtashims,

Could you please try following and let me know if this helps.

echo "<value>WEB_USER</value>" | sed 's/<value>//g;s/<\/value>//g'
Output will be as follows.

WEB_USER
...
2,488
Posted By Don Cragun
For these two lines of input, any of the...
For these two lines of input, any of the following will select only the 2nd line:
grep '^Rome' togrep
grep 'e$' togrep
grep 'o i' togrep
If there is other input that needs to be rejected, or...
2,488
Posted By Aia
grep Romeo.*Rome gotamp.txt
grep Romeo.*Rome gotamp.txt
2,488
Posted By Don Cragun
When you say you have tried all possible greps, I...
When you say you have tried all possible greps, I find that hard to believe. Please show us what you have tried.

Is this a homework assignment?
2,329
Posted By rdrtx1
try also: sed 's/= /=Z/g' infile
try also:
sed 's/= /=Z/g' infile
2,329
Posted By Scrutinizer
Hi, try: sed 's/=\*/=Z/g' file You last...
Hi, try:
sed 's/=\*/=Z/g' file

You last attempt (sed 's!\=\*!\=Z!g' file) should have worked even though the backslash escapes of the = sign are unnecessary and so it could be reduced to:
sed...
1,768
Posted By RavinderSingh13
Hello gotamp, Could you please try following...
Hello gotamp,

Could you please try following and let me know if this helps you.

awk -vLINE="setenv PRICESEQ \"/invest1/iomaint/seqfiles/SHARED.CARDLIB\"" '/^setenv SEQFILES/{print $0 ORS...
16,826
Posted By RavinderSingh13
Hello gotamp, Could you please try following...
Hello gotamp,

Could you please try following and let me know if this helps you.
Let's say following is the Input_file.

cat Input_file
200,1245,E1,1,E1,,7611068,KWH,30, ,,,,,,,,...
1,360
Posted By yazu
I learnt sed here...
I learnt sed here (http://www.catonmat.net/blog/sed-one-liners-explained-part-one/) (but I read something before - this (http://www.grymoire.com/Unix/Sed.html) is good.)
1,360
Posted By yazu
GNU sed with "-E" (or -r - they are the same)...
GNU sed with "-E" (or -r - they are the same) option

For solaris this should work

sed 's!^\([^:]*\):[^=]*=\(.*\)!\1 \2!'
1,402
Posted By Scrutinizer
This should suffice: grep '*[DXM]' file ...
This should suffice:
grep '*[DXM]' file

Given the other character patterns on the lines, it may be better to anchor it to the two forward slashes:
grep '/\*[DXM]/' file
1,402
Posted By RavinderSingh13
Hello gotamp, You could try following...
Hello gotamp,

You could try following solutions for same.
1st Solution:

grep -e '\*M' -e '\*D' -e '\*X' Input_file
Output will be as follows.

C/*M/ / ***HMACCT ** MONTH FOR...
Showing results 1 to 18 of 18

 

Featured Tech Videos

All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy