Search Results

Search: Posts Made By: rahul2662
1,448
Posted By RavinderSingh13
Hello rahul2662, Could you please try...
Hello rahul2662,

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

sed -n 's/\(.*"\)\([^"].*\)\(".*\)/\2/p' Input_file
Output will be as follows.

-A y -L
...
1,448
Posted By RudiC
Try also awk -F\" '{for (i=2; i<=NF; i+=2) print...
Try also awk -F\" '{for (i=2; i<=NF; i+=2) print $i}' file
-A y -L
1,448
Posted By danmero
awk '/\"/{for(i=2;i<=NF;i+=2){print $i}}' FS=\" ...
awk '/\"/{for(i=2;i<=NF;i+=2){print $i}}' FS=\" file
1,448
Posted By Don Cragun
If there is never more than one quoted string on...
If there is never more than one quoted string on a line, the awk can be simplified to:
awk -F\" 'NF>2{print $2}' file
and the sed could be simplified to:
sed -n 's/.*"\(.*\)".*/\1/p' file
1,448
Posted By RavinderSingh13
Hello rahul2662, Following may help you in...
Hello rahul2662,

Following may help you in same, also you haven't mentioned if there are 1 or more occurrences of "" apart from shown in your sample post in a single line, so assuming you have...
3,904
Posted By RavinderSingh13
Hello rahul2662, Following may help you in...
Hello rahul2662,

Following may help you in same.

awk 'NR==1{n=NF;}{if(n==NF){for(i=1;i<=n;i++){A=A?A OFS "<td>"$i"</td>":"<td>"$i"</td>"};print "<tr>"A"</tr>";A=""}}...
3,904
Posted By RavinderSingh13
Hello rahul2662, Following is the...
Hello rahul2662,

Following is the explanation for same which may help you, let me know if you have any queries on same.

awk -F"[[:space:]]+:[[:space:]]+" ####### Making field...
3,904
Posted By RavinderSingh13
Hello rahul2662, Could you please try...
Hello rahul2662,

Could you please try following and let me know if this helps you, not tested though. Please let me know if you have any queries on same.

awk -F"[[:space:]]+:[[:space:]]+"...
3,904
Posted By RudiC
Try alsoawk 'BEGIN {printf...
Try alsoawk 'BEGIN {printf "<html><body><table width=\"600\" border=\"3\" align=\"center\">\n"}
{gsub (/ +/, _)
printf "<tr>"
for (i=1;...
3,148
Posted By agent.kgb
AIX 5.3 has ksh93, but I don't have it anymore...
AIX 5.3 has ksh93, but I don't have it anymore and can't say right now how "fresh" ksh93 there.


awk '
$1 == "EFFECTIVE_TIME" {
print "printf \"EFFECTIVE_TIME %T\n\" \\#"$2
}

$1 !=...
3,148
Posted By Scrutinizer
On AIX the default ksh shell is ksh88. Try...
On AIX the default ksh shell is ksh88. Try running the script using ksh93

A strange thing is that read -a arr is bash syntax, not ksh93 syntax. Try using read -A instead.
3,148
Posted By agent.kgb
i think awk experts in this forum can do it...
i think awk experts in this forum can do it better, but it should work on every system with KSH93.
3,148
Posted By agent.kgb
sorry, 2 slashes forgotten :-) awk '$1 ==...
sorry, 2 slashes forgotten :-)

awk '$1 == "EFFECTIVE_TIME" {print "printf \"EFFECTIVE_TIME %T\n\" \\#"$2} $1 != "EFFECTIVE_TIME" {print "print "$0}' $TMP | ksh93 >$MAIL
2,451
Posted By RavinderSingh13
Hello Rahul, Following is the explanation...
Hello Rahul,

Following is the explanation for same, let me know if you have any queries. Because array A is having $2 as index and array B has as $(NF-1) and $NF. But array A's value is $(NF-1)...
2,451
Posted By RavinderSingh13
Hello looney, Following may help you in...
Hello looney,

Following may help you in same.

awk '{DATE1=date -d $(NF-1) " " $NF; ######### making a variable here with name DATE1 whose value is equal to date -d $(NF-1) " " $NF, where...
2,451
Posted By RudiC
OK, changed my mind, date may not be needed....
OK, changed my mind, date may not be needed. Try:sort -r -k2,2 -k5.7,5.10 -k5.1,5.2n -k5.4,5.5n -k6.10 -k6 file4 | while read line; do FN=${line#* }; FN=${FN%% *}; [ "$FN" != "$LAST" ] && echo...
2,451
Posted By RavinderSingh13
Hello rahul2662, Seems to be you are using...
Hello rahul2662,

Seems to be you are using GNU DATE, then following may help you in same.

awk '{DATE1=date -d $(NF-1) " " $NF;A[$2]=DATE1 > A[$2]?DATE1:A[$2];B[$(NF-1) OFS $NF]=$0} END{for(i in...
2,451
Posted By RudiC
Any attempts from your side? ---------- Post...
Any attempts from your side?

---------- Post updated at 12:40 ---------- Previous update was at 12:35 ----------

What system are you using?
Does it provide a date command providing date...
4,097
Posted By MadeInGermany
@Ravinder, only GNU find defaults to . as the...
@Ravinder, only GNU find defaults to . as the start directory! Unix find gives error if no start directory is given - here unfortunately suppressed with 2>/dev/null
The following lists files and...
8,246
Posted By Corona688
When run by PHP, it will run as the user and...
When run by PHP, it will run as the user and group of the web server, probably apache, which no doubt doesn't have permission to write there and might not even have permissions to execute the script...
1,092
Posted By RudiC
How about awk ' NR==FNR {_1[$1]++ ...
How about awk '
NR==FNR {_1[$1]++
next
}

{IX = 2 + ($2 == "Oracle8")
}
!_1[$IX]

' exclusionfile.txt masterfile.txt
1,092
Posted By RavinderSingh13
Hello rahul2662, Thank you for updating...
Hello rahul2662,

Thank you for updating the sample input and expected output in your post. Could you please try following and let me know if this helps.

awk...
1,247
Posted By Scrutinizer
Try read -ain bash or read -A in ksh93 or zsh. ...
Try read -ain bash or read -A in ksh93 or zsh.



--
Also: IFS=' ' probably means something different than what you had in mind:

In bash it is equivalent to IFS=' ' (1 space), which...
1,247
Posted By MadeInGermany
And if you do nothing else with $line then you...
And if you do nothing else with $line then you can replace
while read line
do
read -a arr <<< "$line"
by
while read -a arr
do
1,247
Posted By RudiC
The solution depends on the file structure, i.e....
The solution depends on the file structure, i.e. the field delimiters. Should those be <TAB>s try while IFS=' ' read -a arr; do ..., and e.g. the two datetime fields will be preserved. If they are...
Showing results 1 to 25 of 62

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