Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Add a block of code at the end of a specific block Post 302933057 by Lakshmikumari on Tuesday 27th of January 2015 07:27:38 AM
Old 01-27-2015
Code:
"block1":"block_111" 
"tabId": "table_0",
 "title":"My title"
 ..... .... 
}]
"block1":"block_111"
 "tabId": "table_1", 
"title":"My title" 
..... ....
 }]
"block1":"block_111" 
"tabId": "table_2",
 "title":"My title" 
..... .... 
}]

It should get changed to

my start patten is
"tabId": "table_1" and my end pattern is the first matching "]"
Code:
"block1":"block_111"
 "tabId": "table_0", 
"title":"My title" 
..... .... 
}]
"block1":"block_111"
 "tabId": "table_1", 
"title":"My title" 
..... .... 
}
my newline1
my newline2
]
"block1":"block_111" 
"tabId": "table_2", 
"title":"My title" 
..... .... 
}]

 

10 More Discussions You Might Find Interesting

1. IP Networking

block telnet to specific port

Hello All I am running redhat linux 7.2 and would like to know how i can block telnetting to a specified port . say for example i would like to block telnet acesses to port 80. regards Xiamin (5 Replies)
Discussion started by: xiamin
5 Replies

2. Shell Programming and Scripting

if clause in AWK END block not working.

Hello all... I have a slight problem in my awk script... I have a script which checks a csv file and keeps a count of any invalid records and then if it finds any, exits with a code of 1. problem is it dosnt seem to work properly :rolleyes: Everthing seem to work interms of the stats output,... (1 Reply)
Discussion started by: satnamx
1 Replies

3. Shell Programming and Scripting

Extracting specific block

Hi Everyone , have a great day i have a file which has almost 20,000 blocks each starting with this particular line " rTCCreditControlRecord " , how can i bring out the 7172 block out of that file Thanks in Anticipation (7 Replies)
Discussion started by: Dastard
7 Replies

4. Shell Programming and Scripting

array access in END block failure

Hi guys i am new to shell scripting. I wrote this script that simply searches a column value of file1 from file2. please look at the code below: awk ' FILENAME==ARGV { file_1_data=$0; next } FILENAME==ARGV { file_2_data=substr($3,1,12); next } END { ... (5 Replies)
Discussion started by: fahadaizaz
5 Replies

5. Shell Programming and Scripting

Add sth to end of each line, but only for specific files

Hi. I have a list with files, and I would like to add a variable to the end of each line of each file in this list. The files are in a folder together with a large number of other files which I don't want to change. My code is: for file in 'cat ../list' do sed 's/$/\/R:_0/' $file >>... (4 Replies)
Discussion started by: Bloomy
4 Replies

6. UNIX for Dummies Questions & Answers

sed - Add a variable line to the end of a block beginning with a regex

Hi, Need some help with sed. I have a file that has sections : e.g. a=blah b=blah d=blah e=blah There's many sections in the file. (1 Reply)
Discussion started by: andyatit
1 Replies

7. SCO

OSR 5.0.7 need to block a specific IP

There are huge number of messages in syslog suggesting one of the client's IP is trying to telnet/ssh/pop/imap into the OSR5.0.7 system, it happens every minute or so, see a snippet below Oct 9 13:11:20 myhost popper: (null) at 192.168.1.123 (192.168.1.123): -ERR POP EOF or I/O Error: 25... (3 Replies)
Discussion started by: migurus
3 Replies

8. Shell Programming and Scripting

Define procedure in block END in awk

Hi :) Yo quisiera saber si se puede definir procedimientos dentro del bloque END. for example ... BEGIN {i=1} { if ($1 == $2) cadena = $3 } END { find_letter(cadena) } find_letter(cadena { ... } (3 Replies)
Discussion started by: solaris21
3 Replies

9. Shell Programming and Scripting

Search a String between start and end of a block in a file

Hi, I have a scenario where I want to display the output based on the pattern search between the start and end of a block in a file, we can have multiple start and end blocks in a file. Example give below, we need to search between the start block abc and end block def in a file, after that... (5 Replies)
Discussion started by: G.K.K
5 Replies

10. Solaris

Block port for all except for one specific ip in Solaris11.4

Hi, I need to block ssh port 22 from all the servers except one server ip. Until solaris11.3 and below, I used to do like below(under /etc/ipf/ipf.conf),and it's working fine pass in quick from $server_ip to any port=22 block in quick from any to any port=22 But I tried almost same in... (1 Reply)
Discussion started by: Sumanthsv
1 Replies
pgfouine(1)							   User Commands						       pgfouine(1)

NAME
pgfouine - PostgreSQL log analyzer SYNOPSIS
pgfouine -file <file> [-top <n>] [-format <format>] [-logtype <logtype>] [-report [outputfile=]<block1,block2>] DESCRIPTION
-file <file> log file to analyze - read the log from stdin instead of -file -top <n> number of queries in lists. Default is 20. -format <format> output format: html, html-with-graphs or text. Default is html. -logtype <logtype> log type: syslog or stderr. Default is syslog. for stderr, you have to use the following log_line_prefix: '%t [%p]: [%l-1] ' -report [outputfile=]<block1,block2> list of report blocks separated by a comma report blocks can be: overall, hourly, bytype, slowest, n-mosttime, n-mostfrequent, n-slowestaverage, history, n-mostfrequenterrors, tsung You can add several -report options if you want to generate several reports at once -examples <n> maximum number of examples for a normalized query -onlyselect ignore all queries but SELECT -from "<date>" ignore lines logged before this date (uses strtotime) -to "<date>" ignore lines logged after this date (uses strtotime) -database <database> consider only queries on this database -user <user> consider only queries executed by this user -title <title> define the title of the reports -syslogident <ident> PostgreSQL syslog identity. Default is postgres. -memorylimit <n> PHP memory limit in MB. Default is 128. -debug debug mode -profile profile mode -help this help AUTHOR
pgfouine was written by Guillaume Smet <guillaume-pg at smet dot org>. This manpage was written by Clement Stenac <zorglub at debian dot org> for the Debian project, but may be used by others. pgfouine August 2006 pgfouine(1)
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy