Sponsored Content
Top Forums Shell Programming and Scripting Problem with filter data using sed command Post 302734939 by nanthagopal on Friday 23rd of November 2012 06:47:42 AM
Old 11-23-2012
Problem with filter data using sed command

Hi,

I am using the following command(sed) to get the key/value pair from the string

Code:
String="{ "test":"test message", "testmessage":"subscription is active, charge successfully} " }"
status=$( echo $String | sed -e 's/^.*\("testmessage":[^,]*\).*$/\1/')
echo $status

i am getting this output : "testmessage":"subscription is active

Expected output: "testmessage":"subscription is active, charge successfully"

Please Suggest me,
Regards,
Nanthagopal A

Moderator's Comments:
Mod Comment Use code tags - see PM, thanks.

Last edited by zaxxon; 11-23-2012 at 07:57 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

filter data

Hi I have two files and their names are donotcall.txt, filter_it.txt. I want output.txt file with all data that is in filter_it.txt file but not in donotcall.txt. Can anybody help me to write 1-2 lines unix code for this. donotcall.txt contains following data. Each row represent phone... (3 Replies)
Discussion started by: deep.singh
3 Replies

2. Shell Programming and Scripting

extract data from a data matrix with filter criteria

Here is what old matrix look like, IDs X1 X2 Y1 Y2 10914061 -0.364613333 -0.362922333 0.001691 -0.450094667 10855062 0.845956333 0.860396667 0.014440333 1.483899333... (7 Replies)
Discussion started by: ssshen
7 Replies

3. UNIX for Dummies Questions & Answers

How to filter data

Hi all, I require assistance in this. I'd like to filter the following data to extract WADRAIN. RAIN, 2003-01-01 00:00, 1, WADRAIN, 900, 1, 24109, 1011, 1.6, 0, 6, RAIN, 2003-01-01 00:00, 1, DLY3208, 900, 1, 30747, 1011, 1.8, 0, 6, RAIN, 2003-01-01 00:00, 1, WADRAIN, 900, 1, 24775,... (6 Replies)
Discussion started by: Muhammad Rahiz
6 Replies

4. Linux

filter data

hi all, here is my question. i have the following data Block 1 a b c d e f g h i Block 2 j k l m n o p q r i need to grep all information from block 1 i.e 'a to i' (6 Replies)
Discussion started by: yprudent
6 Replies

5. Shell Programming and Scripting

Filter date and time form a file using sed command

I want to filter out the date and time from this line in a file. How to do this using sed command. on Tue Apr 19 00:48:29 2011 (12 Replies)
Discussion started by: vineet.dhingra
12 Replies

6. UNIX for Dummies Questions & Answers

Need to filter data from a file

Hi, I have a file with hundreds of records. There are four fields on each line, separated by semicolons. Name Height (meters) Country Continent (Africa,Asia,Europe,North America,Oceania,South America,The Poles) I need to Write the command to find display how many mountains appear... (1 Reply)
Discussion started by: erora
1 Replies

7. UNIX for Dummies Questions & Answers

Command line / script option to filter a data set by values of one column

Hi all! I have a data set in this tab separated format : Label, Value1, Value2 An instance is "data.txt" : 0 1 1 -1 2 3 0 2 2 I would like to parse this data set and generate two files, one that has only data with the label 0 and the other with label -1, so my outputs should be, for... (1 Reply)
Discussion started by: gnat01
1 Replies

8. Shell Programming and Scripting

How to grep/sed selected data from a command or file?

Below is the output of a DB2 command. Now I have 2 requirements... Database Partition 0 -- Database TESTDB1 -- Active Standby -- Up 213 days 02:33:07 -- Date 02/22/2016 17:04:50 HADR Information: Role State SyncMode HeartBeatsMissed LogGapRunAvg (bytes) Standby ... (2 Replies)
Discussion started by: rlokesh27
2 Replies

9. Shell Programming and Scripting

Problem in extracting data using cut/awk command

Hi Everyone, I have a very simple problem and i am stuck in that from last 8 days. I tried many attempts, googled my query but all in vain. I have a text file named "test.txt" In that suppose i have contents like: Java: 1 Object oriented programming language 2 Concepts of Abstraction... (5 Replies)
Discussion started by: Abhijeet Anand
5 Replies

10. UNIX for Beginners Questions & Answers

Including Hash / in sed command filter

Hello All, I want to print data in between two lines in a file sample.txt through more or cat command on the screen. For that I am using below sed command to give the BEGIN and END text. Content of sample.txt server01:~ # cat /proc/mdstat Hello this is a text message 1 Hello this is a... (5 Replies)
Discussion started by: Xtreme
5 Replies
subscriptions.conf(5)						    Apple Inc.						     subscriptions.conf(5)

NAME
subscriptions.conf - subscriptions file for cups DESCRIPTION
The subscriptions.conf file defines the local subscriptions that are active. It is normally located in the /etc/cups directory and is gen- erated automatically by the cupsd(8) program when subscriptions are created, renewed, or cancelled. Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character. DIRECTIVES
<Subscription NNN> ... </Subscription> Defines a subscription. Events name [ ... name ] Specifies the events that are subscribed. ExpirationTime unix-time Specifies the expiration time of a subscription as a UNIX time value in seconds since January 1st, 1970. Interval seconds Specifies the preferred time interval for event notifications in seconds. JobId job-id Specifies the job ID associated with the subscription. LeaseDuration seconds Specifies the number of seconds that the subscription is valid for. If 0, the subscription does not expire. NextEventId number Specifies the next notify-sequence-number to use for the subscription. NextSubscriptionId number Specifies the next subscription-id to use. Owner username Specifies the user that owns the subscription. PrinterName printername Specifies the printer or class associated with the subscription. Recipient uri Specifies the notify-recipient-uri value for push-type notifications. UserData hex-escaped-data Specifies user data to be included in event notifications. This is typically the "from" address in mailto: notifications. SEE ALSO
classes.conf(5), cupsd(8), cupsd.conf(5), mime.convs(5), mime.types(5), printers.conf(5) http://localhost:631/help COPYRIGHT
Copyright 2007-2013 by Apple Inc. 30 April 2006 CUPS subscriptions.conf(5)
All times are GMT -4. The time now is 06:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy