Search Results

Search: Posts Made By: Ravindra Swan
2,017
Posted By RudiC
If I understand correctly, you want to read from...
If I understand correctly, you want to read from the terminal every other time. You can do that with input redirection. Try:exec 3<&0

while read line
do echo "press oprion"
...
1,630
Posted By pamu
modified your code try key="phani;ravi;kiran"...
modified your code
try
key="phani;ravi;kiran"
number_of_keys=$(echo $key|awk '{print NF}' FS=';')
for (( i = 1; i <= $number_of_keys; i++ ));
do
key=$(echo $KEY_TO_COMPARE|awk -v var=i 'BEGIN {...
1,630
Posted By PikK45
Or key="phani;ravi;kiran" echo $key | tr...
Or

key="phani;ravi;kiran"
echo $key | tr ';' '\n' > keys.lst
grep -if keys.lst /home/t.txt > temp.txt

hope this helps :)
1,630
Posted By Scrutinizer
grep -if <(IFS=\;; printf "%s\n" $key)...
grep -if <(IFS=\;; printf "%s\n" $key) file
1,630
Posted By Yoda
Use parameter substitution instead. Assuming...
Use parameter substitution instead. Assuming there are no blank space separated values in key:
key="phani;ravi;kiran"

for k in ${key//;/ }
do
grep -i "$k" /home/t.txt
done > temp.txt
3,480
Posted By rbatte1
I don't see where AI_DML gets set, but I presume...
I don't see where AI_DML gets set, but I presume it is an environmental variable.

You can remove the complex echo | awk to be just:-DML_FILE_NAME_ORIG1="${line%%|*}".... or perhaps change the...
2,135
Posted By Yoda
Using array is the best option for this...
Using array is the best option for this requirement.

You could code something like below:
#!/bin/bash

typeset -a table_name
typeset -i c

while read tn
do
(( ++c ))
...
36,224
Posted By pamu
Hi, Please look at below. This is what...
Hi,

Please look at below.

This is what i have imagined so far.(this is just base structure we can modify this if it is as per your requirement.:))

Please do let me correct if am missing...
36,224
Posted By pamu
just one correction needed.. escape sequence for...
just one correction needed.. escape sequence for "."

Now try..

awk -F "\\\.mdc\||\\\.mpc\||\\\.mp\|" '{if($0~/Layout\|\$\[\[recor/){s=$0;}
else if($0~/program files\\\\Ab...
36,224
Posted By pamu
I observed above that you have two patterns at...
I observed above that you have two patterns at the end of the line..

{30001002|XXparameter|!prototype_path|C:\\Program Files\\Ab Initio\\Ab Initio...
36,224
Posted By pamu
As per my observation.. see below... It is C...
As per my observation.. see below...
It is C directory

{30001002|XXparameter|!prototype_path|C:\\Program Files\\Ab Initio\\Ab Initio GDE\\Components\\Transform\\Join.mpc|3|2|Pw$|@{0|}}try this.....
36,224
Posted By pamu
Just find one common line to get the partitions.....
Just find one common line to get the partitions.. And if your common pattern is same it will work for all the patterns..
like Ab Initio 1438 is common for all the partitions.. just find that pattern...
36,224
Posted By pamu
Is this want you want..? awk -F "\\"...
Is this want you want..?


awk -F "\\" '{if($0~/Layout\|\$\[\[recor/){s=$0;}
else if($0~/Ab Initio 1438\\/){split($11,a,".");x++;fn=a[1]x;{print s > fn ;s=""}}
else if(s){s=s"\n"$0}...
36,224
Posted By pamu
still not clear what you want.. In every post...
still not clear what you want..
In every post your requirement changes...
As per your tried code above..
try this..
awk '/Layout\|\$\[\[recor/{fn="file_"++x} x{print > fn}' file
36,224
Posted By pamu
awk '{if($0 ~...
awk '{if($0 ~ /XXparameter\|Layout\|/){L=$0}else{if(L){if($0 ~ /tag/){t++;s="tag"t}else{m++;s="main"m}{print L>s;L=""}}{print > s}}}' file
36,224
Posted By RudiC
For the colouring of lines, I leave this for your...
For the colouring of lines, I leave this for your exercise. For the first line, you may want to print your colour escape sequences around the a in the print a > fn statement.
For the file numbering,...
36,224
Posted By RudiC
I don't understand. As I pointed out before, all...
I don't understand. As I pointed out before, all the "Layout" lines in your sample are identical. What should be the filename?

WAIT! There's main and tag in the line after the "Layout" line. Try...
36,224
Posted By RudiC
I have to emphasize raj_saini20's request to be...
I have to emphasize raj_saini20's request to be more specific, as e.g. all the characteristic lines are identical. However, assuming the line containing "Layout" being the separator, this should do...
36,224
Posted By pamu
try this.. awk '{if($0 ~...
try this..

awk '{if($0 ~ /XXparameter\|Layout\|/){a++;print > "file_"a}else{if(a){print > "file_"a}}}' file


for your above record two files are created..

$ls file_*
file_1 file_2
Showing results 1 to 19 of 19

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