Sponsored Content
Top Forums Shell Programming and Scripting Help in adding a data after a particular line of data in a file. Post 302582460 by arjun_arippa on Friday 16th of December 2011 03:35:48 AM
Old 12-16-2011
Hi michaelrozar17 Image
Registered User



while using this
Code:
sed 's/pgmId.*$/&\nnew_data/' inputfile

i'm getting the following error:
Code:
 sed: Function /pgmId/ a\'moduleId':'DEFAULT' cannot be parsed.

---------- Post updated at 02:05 PM ---------- Previous update was at 01:46 PM ----------

for all the answers given above, i'm able to add just moduleId default..

I wanted to add the line as
Code:
'moduleId'   : 'DEFAULT',

the error i'm getting is that the above said line cannot be parsed

Last edited by Scott; 12-16-2011 at 05:32 AM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding data behind a line

Hi, I need to search for the line with the particular group name and add the user into the group. The file format is the same as /etc/group The code i wrote is egrep "^$newGID" $group >/dev/null FS=":" oldData=awk -F: '{print $3}' newData= "$oldData,$newUser" sed -n $4/$newData $group... (1 Reply)
Discussion started by: cherrywinter
1 Replies

2. Shell Programming and Scripting

Need Help for Adding Three new columns in existing file from fatching data from file

not required this time (36 Replies)
Discussion started by: Sandeep_Malik
36 Replies

3. Shell Programming and Scripting

adding the data at a specified location in a file....

Hi all, I m new to shell programming..Can anyone please guide me how to insert data at a specified location in the file.. I have a configuration file..I want to add data to it through script..I am able to do it...I get that data written at end of my configuration file..I want data to be placed at... (3 Replies)
Discussion started by: divya_flora
3 Replies

4. Shell Programming and Scripting

Adding data in a file on same line

Hi, I have one file a.txt ,the contents of the file is A B C D E F and I have another file b.txt, the contents of the file is 1 2 3 4 5 6 now when I am using this command cat a.txt b.txt > c.txtI am getting the output as A B C D E F 1 2 3 4 5 6 but i need the output... (2 Replies)
Discussion started by: prarat
2 Replies

5. Shell Programming and Scripting

Adding the data before file extension

HI , I have a file with multiple lines like below, I need to check on column starting with #prototype if it has the .Number.txt extension do nothing else add 1.txt extension. Source data Jdbc_app_data :- sample data #prototype= sample data from test.1.txt application_id=122135... (4 Replies)
Discussion started by: gaur.deepti
4 Replies

6. Red Hat

Adding a data file

I need to add a data file, but my user account doesn't have privileges. I have connected to the oracle as sqlplus / as sysdba and it is telling me I'm connect to an idle instance. How can I connect to my database and create a data file if I don't know the passwords of any of the account that have... (1 Reply)
Discussion started by: FaSho76
1 Replies

7. UNIX for Dummies Questions & Answers

Mapping a data in a file and delete line in source file if data does not exist.

Hi Guys, Please help me with my problem here: I have a source file: 1212 23232 343434 ASAS1 4 3212 23232 343434 ASAS2 4 3234 23232 343434 QWQW1 4 1134 23232 343434 QWQW2 4 3212 23232 343434 QWQW3 4 and a mapping... (4 Replies)
Discussion started by: kokoro
4 Replies

8. Shell Programming and Scripting

Adding data from a file based on some condition

I collect data in a file in below format(Month Day Year Size) in RedHat Linux. Now i want to calculate the data size date wise. As i code shell script after long time, i forgot the features and syntax. Can anyone help me regard this please. Feb 8 2014 15 Feb 10 2014 32 Feb 10 2014 32 Feb 12... (2 Replies)
Discussion started by: makauser
2 Replies

9. Shell Programming and Scripting

Adding a comment in a file next to data

Dear Gurus, I have a file which comes every day with set of data, as a part of processing i want to add a comment at the start of every line. e.g of file <PCL> 2E;"HCA";"COP Car A";"ODBS_CFG" 7C;"DD";"Doors Car D";"ODBS_CFG" 3D;"XA";"Auxiliary Car A";"ODBS_CFG" 3E;"XB";"Auxiliary... (12 Replies)
Discussion started by: guddu_12
12 Replies

10. UNIX for Beginners Questions & Answers

UNIX help adding data to end of a line with a variable

I am trying to add a date variable to the end of each line. This is what I have to start with cat ${DATAPATH}/Participate_Stream${STREAMDATE}.dryak1.csv | grep ^',' | awk '{print $0}' >> ${DATAPATH}/badparticipant.csv This is what I tried $DATE is a variable I have defined. cat... (3 Replies)
Discussion started by: req62861
3 Replies
Locale::Codes::LangExt(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangExt(3pm)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-11-04 Locale::Codes::LangExt(3pm)
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy