Search Results

Search: Posts Made By: ganesan kulasek
6,490
Posted By elixir_sinari
Change !/^(<\?xml...
Change
!/^(<\?xml version="1\.0"\?>|<\/?notification>)$/ {
to
!/^[[:blank:]]*(<\?xml version="1\.0"\?>|<\/?notification>)[[:blank:]]*$/ {
or
!/^[ \t]*(<\?xml...
6,490
Posted By elixir_sinari
Change if(!(($N ~ /<alarmId>/)||($N ~...
Change
if(!(($N ~ /<alarmId>/)||($N ~ /<[/]?alarmNew/))) $N="";
to
if(!(($N ~ /<alarmId>/)||($N ~ /<\/?alarmNew/))) $N="";
6,490
Posted By Corona688
Yes, thoug you need a space between nawk and -f...
Yes, thoug you need a space between nawk and -f of course. * should work for all xml files in a folder. Expanding * into multiple filenames is a property of the shell, not of awk, so it should work...
6,490
Posted By CarloM
Isn't this the same issue as your other thread...
Isn't this the same issue as your other thread (https://www.unix.com/shell-programming-scripting/198853-want-skip-line-xml-file-using-awk.html)?
6,490
Posted By Corona688
$ cat xmlcat.awk BEGIN { RS="" ...
$ cat xmlcat.awk

BEGIN {
RS="" # Split records on blank lines
FS=OFS="\n" # Each field is a different line
ORS="\n\n" # Output blank lines, too
}
...
6,490
Posted By elixir_sinari
And what does your awk script look like after...
And what does your awk script look like after incorporating the changes I suggested?
6,490
Posted By elixir_sinari
The change suggested by delugeag will do the job....
The change suggested by delugeag will do the job. I didn't pay much attention to it as I had, in my code, put that on the same line. But, you didn't.

Don't fret and pay attention to the...
6,490
Posted By delugeag
no it's not the same, there is a bold { in the...
no it's not the same, there is a bold { in the line with the new test.
You have to know this :

#!/bin/awk -f
/test/
{
code
}
it's not the same than :


#!/bin/awk -f
/test/ {
code
}...
6,490
Posted By elixir_sinari
A little more explanation: When you put a...
A little more explanation:

When you put a pattern on a line by itself without the opening brace for the corresponding action, awk assumes that that's the end of your pattern-action block. So, if...
Showing results 1 to 9 of 9

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