Search Results

Search: Posts Made By: cgkmal
1,998
Posted By cgkmal
You're rigth. Please use instead. awk...
You're rigth. Please use instead.


awk 'BEGIN{RS=">\n"} NF>=8{print $0">"}' file

Regards
1,998
Posted By cgkmal
Hi my_Perl, You can try: awk...
Hi my_Perl,

You can try:
awk 'BEGIN{RS=">\n"} NF>=8{print}' file
Regards
6,436
Posted By cgkmal
Hi Scrutinizer, Many thanks. Your last...
Hi Scrutinizer,

Many thanks.

Your last code it seems to work. I'll try using this was in my further analsys.

Regards
6,436
Posted By cgkmal
Hello Aia, Thanks for the help, but actually...
Hello Aia,

Thanks for the help, but actually I want to set that string as Record Separator since each block begins with "No. ...." and I need to process further.

Thanks for any help
6,436
Posted By cgkmal
Hello Scrutinizer, Thanks for your reply. ...
Hello Scrutinizer,

Thanks for your reply.

I've tried your solution but I only receive the first record and if I try to print the first field for all records (28, 29 and 30), I only receive the...
6,436
Posted By cgkmal
Use string as Record separator in awk
Hello to all,

Please some help on this. I have the file in format as below.

How can I set the record separator as the string below in red
"No. Time Source ...
4,591
Posted By cgkmal
Hello asnandhakumar, One more option for...
Hello asnandhakumar,

One more option for you.
awk -F, 'FNR==NR {x[$1]=$0;next} z=($2 in x)?$0","x[$2]:$0 {print z; x[$2]=""}' file2 file1Regards
7,294
Posted By cgkmal
Filtering protocol and string in tcpdump command?
Hello to all in forum,

Maybe some unix expert could help me. I have the following tcpdump command:

tcpdump -i any port 13907 -s 0 -w Out.cap

I would like to run tcpdump to only capture data...
5,255
Posted By cgkmal
You are correct, is chmod u+w, it was a typo :D. ...
You are correct, is chmod u+w, it was a typo :D.

The permissions are as follow:
/etc/apache2/sites-available$ ls -l
total 12
-rw-r--r-- 1 root root 946 2012-02-06 18:24 default
-rw-r--r-- 1...
5,255
Posted By cgkmal
Thank you, thank you Scrutinizer, it works!!! ...
Thank you, thank you Scrutinizer, it works!!!

Only 2 questions more:
the 000-default had before permissions 777 and wasn't working for me after I did chmod u+v how you suggested me. Why?

Do I...
5,255
Posted By cgkmal
Hello Scrutinizer, thanks for answer. I've...
Hello Scrutinizer, thanks for answer.

I've just see the ../sites-available/default I didn't know about that relation.

So, you meam if I edit ../sites-available/default will be enough and that...
5,255
Posted By cgkmal
Problems activating "mod_rewrite" (I can't edit 000-default file)
Hello everyone,

Maybe an expert could help me..

I'm trying to activate mod_rewrite module on a Ubuntu 11.04 server (natty) and I having problem to edit the file 000-default in 3rd step, the...
2,138
Posted By cgkmal
Hi James, Another option would be: awk...
Hi James,

Another option would be:
awk -F[”] 'BEGIN{print "FullName Age D.O.B Gender"}
/NAME/{A[$6]++; G[$10]++; print $4, $6, $8, $10}

END{ print "\nAge count\n"
for (i in A)...
2,948
Posted By cgkmal
Many thanks anchal_khare, for sure it will help...
Many thanks anchal_khare, for sure it will help me a lot, I've read the links you suggested me and I understand many more things of your script now.

Great support and help from you.

Much...
2,948
Posted By cgkmal
Hi anchal_khare, I can see it works, many...
Hi anchal_khare,

I can see it works, many thanks, only I don't understand some of the syntax in your code, may you explain me please the parts in red please?

1-) echo ${i/_vi/_ci} # What does...
12,228
Posted By cgkmal
Thanks ahmed works great, only I'm figure it out...
Thanks ahmed works great, only I'm figure it out how to print only the "<food>" blocks removing the others lines that could be
present ("<? xml...", "<breakfast_menu", "</breakfast_menu" etc).
...
12,228
Posted By cgkmal
Hi ahamed, Works great!! But, how can I...
Hi ahamed,

Works great!!

But, how can I add a text line after each <Catg>?

I have the code below, but how to include it in your code?
Var="Today Breakfast"
sed '/<Catg>/a\<Unit><Data...
12,228
Posted By cgkmal
Using SED with variable to replace strings in while loop
Hi guys,

Hi have this input (Menu.xml)<?xml version="1.0" encoding="ISO-8859-1"?>
<breakfast_menu>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price> ...
2,948
Posted By cgkmal
Hello anchal_khare, Many thanks for reply...
Hello anchal_khare,

Many thanks for reply and give some of your time to share your knowledge to help. Your code works beautifully!

With your code I've learned more than one thing new.
1-) I...
2,948
Posted By cgkmal
Hi ahamed, I intend to parse the input in...
Hi ahamed,

I intend to parse the input in that way because the output would be open in MS Excel, but showing in different layout, as I said before, without repeat the names, only show them once...
2,948
Posted By cgkmal
Hi, thanks for answer. Sorry for my...
Hi, thanks for answer.

Sorry for my explanation. In input file there are repeated names and in the output only appear once with their corresponding values. Maybe you could understand better only...
2,948
Posted By cgkmal
Change XML file structure script
Hi to all,

Maybe someone could help me. I want to transform the structure of a xml file.

I have this input.xml:
<?xml version="1.0" encoding="utf-8"?>
<votings>
<file name="Reference...
4,531
Posted By cgkmal
Hi Franklin, Nice code to change field...
Hi Franklin,

Nice code to change field separator. I modificated file1 and file2 created 2 temp files, then I run the 2nd code and the results now are correct and I stored in temp3.

Finally I...
4,531
Posted By cgkmal
Thanks Franklin, I'll try your suggestion. ...
Thanks Franklin, I'll try your suggestion.

Many thanks again.

Best regards

---------- Post updated at 05:00 PM ---------- Previous update was at 03:00 AM ----------

Hi again Fraklin,
...
4,531
Posted By cgkmal
Hi Franklin, I only changed the assignation...
Hi Franklin,

I only changed the assignation of idx as below and it works for sample file.
awk -F, '
NR==FNR{idx=$1; a[idx]=$5;b[idx]=$2;c[idx]=$4;d[idx]=$3; next} FNR==1{print; next} ...
Showing results 1 to 25 of 289

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