Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: dashing201
811
Posted By dashing201
Hi Ravindra I have tried your suggestion...
Hi Ravindra

I have tried your suggestion with some modification

echo "Hi this is another abc.post. This post is new. Not compost. Dummy String - dbc.post."|awk '{for(i=1;i<=NF;i++){if($i ~...
811
Posted By dashing201
thanks anyways. I have already shared above...
thanks anyways.
I have already shared above what I tried.
May be I didn't put things very clearly at first place. But if things are "hardcoded" life becomes so simple. Right ?
811
Posted By dashing201
Hi Ravindra Thanks for quick reply. Actual...
Hi Ravindra

Thanks for quick reply.
Actual "post" is also a dummy keyword.
I have to run while loop for 20,000 such keywords.

Please share more generic solution.
811
Posted By dashing201
sed to update string pattern
Hi
I have to update string pattern using sed. If I find any keyword "post" I have to add a function "yahoo" to that keyword. The keyword "post" may or may not come with some prefix too like...
965
Posted By dashing201
Hi Scott thanks for prompt reply. However I...
Hi Scott
thanks for prompt reply.
However I am specifically looking for regex as the same code may be executed in unix shell or other languages.

Thanks
Nitin
965
Posted By dashing201
Regex to identify pattern
Hi
In a file I have string in multiple lines. Like below:

<?=test.getObjectName("L", "testTBL","D") ?>
<?=test.getObjectName("L", "testTBL","testDB", "D") ?>

I want to use regex to search...
573
Posted By dashing201
Hi Jim Thanks for quick reply. I am...
Hi Jim

Thanks for quick reply.
I am exporting data from RDBMS table into flat file with FIELDS TERMINATED BY '#' LINES TERMINATED BY '\n'.
However in the file there are few strings which have \n...
573
Posted By dashing201
How to handle new line if it is EOL or present as part of string?
Hi All

I am facing some issues while processing a file.
The file has \n as End Of Line. However for some records '\n' is also present as part of string. Hence I am not able to identify proper...
694
Posted By dashing201
Hi Andrew Thanks for quick reply. However...
Hi Andrew

Thanks for quick reply.
However I am not getting proper result

echo "NET_SALES^M ^M---- new fields for -- ^M ,YABA_FLAG^M ,DOO_FLAG^M"|sed 's/--[^\r]*\r//g'

Output:
...
694
Posted By dashing201
Search and Delete pattern with Control M
Hi
I have data file like below:

NET_SALES^M ^M---- new fields for -- ^M ,YABA_FLAG^M ,DOO_FLAG^M

My requirement is to search for atleast 2 -- and remove all the words till first ^M is...
7,967
Posted By dashing201
Hi Ravinder/Sea Thanks for the quick reply. ...
Hi Ravinder/Sea

Thanks for the quick reply.
However if I have to implement a check to confirm if all the process have been completed then how can I do it ?
It is required to make sure that all...
7,967
Posted By dashing201
Run script in parallel in while loop
Hi
I am running a loop which actually runs same script for different argument value passed to it.

while read repID
do
echo "Starting for $repID";
date;
perl process_report.pl $repID ...
1,914
Posted By dashing201
tried this. still not working. awk -v...
tried this. still not working.
awk -v var1=$key1, -v var2=$key2 '$0 ~ /var1/ {if($0 ~ /COMPRESS/) {sub("COMPRESS.*",var2)} else {sub("$",var2) }}1' FILENAME.txt
1,914
Posted By dashing201
Hi When I am running the below code I m not...
Hi
When I am running the below code I m not getting the desired output.

awk '$0 ~ /$key1/ {if($0 ~ /COMPRESS/) {sub("COMPRESS.*",$key2)} else {sub("$",$key2) }}1' FILENAME.txt

However if I am...
1,914
Posted By dashing201
Search for a Keyword in file and replace another keyword or add at the end of line
Hi

I want to implement something like this:

if( keyword1 exists)
then
check if(keyword2 exists in the same line)
then replace keyword 2 with New_Keyword
else
Add...
1,528
Posted By dashing201
Amazing superb . Worked beautifully :) Thanks...
Amazing superb .
Worked beautifully :)
Thanks Akshay.

@Jotne: Thanks for the prompt reply.
1,528
Posted By dashing201
Added code tag !!!
Added code tag !!!
1,528
Posted By dashing201
Hi Guys, In the same case, a little...
Hi Guys,

In the same case, a little different scenario. If the requirement is like :

Input File:

HELLO 100-105 107 108-112
HI 201 204-209 210


OUTPUT Required:

HELLO~100 HELLO~101...
1,528
Posted By dashing201
Thank You Akshay & Pravin. Now it is working...
Thank You Akshay & Pravin.
Now it is working beautifully.
1,528
Posted By dashing201
Fill data if number range is given
Hi
I want to get all numbers if number range is given as input.
Eg:

INPUT FILE
100-105
107
108-112

OUTPUT REQUIRED:
100 101 102 103 104 105
107
108 109 110 111 112


How can I do it...
1,949
Posted By dashing201
Thanks a lot. It worked beautifully :D
Thanks a lot.
It worked beautifully :D
1,949
Posted By dashing201
[Solved] Change Date from one format to other
Hi

I wish to change date from one format to another in unix.

eg: INPUT DATE: 2013159 (YEAR & NUMBER OF DAY)
OUTPUT DATE required: 20130608 (YYYYMMDD)

how to do it ?

Thanks in advance.
959
Posted By dashing201
Grep Keywords one by one
Hi

I am trying to determine number of lines having a specific keyword.
So for that I am using below query:

grep -i 'keyword1' filename|wc -l

This give me number of lines. Perfect for me....
1,831
Posted By dashing201
Thanks to all. It worked fine. All the...
Thanks to all.
It worked fine.
All the suggestions worked perfectly fine. :)
1,831
Posted By dashing201
Hi Rajamadhavan Thanks for prompt reply. ...
Hi Rajamadhavan

Thanks for prompt reply.
How to assign the output to a variable in PERL ? [Assuming I will get only one line]
Showing results 1 to 25 of 85

 

Featured Tech Videos

All times are GMT -4. The time now is 03:36 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy