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
pbmtopsg3(29 June 2001)                                                                                                    pbmtopsg3(29 June 2001)

NAME
pbmtopsg3 - convert PBM images to Postscript with G3 fax compression SYNOPSIS
pbmtopsg3 [--title=title] [--dpi=dpi] [filespec] DESCRIPTION
Converts the PBM images in the input PBM file to pages in a Postscript file encoded with G3 fax compression. If you don't specify filespec, the input is from Standard Input. Remember that you can create a multi-image PBM file simply by concatenating single-image PBM files, so if each page is in a different file, you might do: cat faxpage* | pbmtopsg3 >fax.ps OPTIONS
-title The Postscript title value. Default is no title. -dpi The resolution of the Postscript output. Default is 72 dpi. SEE ALSO
pnmtops(1), pstopnm(1), gs(1), pstopnm(1), pbmtolps(1), pbmtoepsi(1), pbmtog3(1), g3topbm(1), pbm(5) pbmtopsg3(29 June 2001)
All times are GMT -4. The time now is 02:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy