Sponsored Content
Full Discussion: Replace [|] in perl
Top Forums Shell Programming and Scripting Replace [|] in perl Post 302636295 by irudayaraj on Monday 7th of May 2012 09:05:39 AM
Old 05-07-2012
Replace [|] in perl

Hi
I have a file newfile.txt in perl. Its content is

Code:
22533978[|]06-Dec-11 03.04.14.000000 PM[|]99999[|]01-May-12 03.28.21.000000 PM[|]22[|]2212{|}
29055978[|]03-Jan-12 01.24.24.000000 AM[|]Bank_CreateCustomerDET[|]01-May-12 11.14.53.000000 AM[|]23[|]2382{|}


I have to replace [|] by |
and {|} by newline character
I tried with sed but it doesnt work and it replaces [|] by |||.

Can someone help with this. Thanks in advance.

Last edited by Scrutinizer; 05-07-2012 at 10:16 AM.. Reason: Replace quote tags with code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace Perl Module name in all Perl scripts

I want to replace a Perl module name in all my Perl Scripts in the cgi-bin directory. How is it possible? I have the following statement in my scripts use myUtil; I want to change it to use myUtil777; Regards, Rahul (2 Replies)
Discussion started by: rahulrathod
2 Replies

2. Shell Programming and Scripting

Search and replace in Perl

Hello, I have a Perl script that reads in an Excel spread sheet and formats the values into a text file. I am having trouble with one column that can have numbers or letters. Excel left justifies the values that start with a letter and right justifies the values that contain only a... (2 Replies)
Discussion started by: jyoung
2 Replies

3. Shell Programming and Scripting

How to replace string in perl?

Hi, I have string like this: $query="#1,apple"; $string=$query; I want to replace #1 with fruit. I tried like this: string=~s/#\d+/$query/ig; print "\n string: $string\n"; It is working only when there is single #1 or #2 but when i give like #1,#2,#3,apple the above code... (2 Replies)
Discussion started by: vanitham
2 Replies

4. Shell Programming and Scripting

How to replace a value in a file in perl?

Hi, I have a file with the following contents and i want to replace that value in a file with some other value. #file.txt /local/Disk/data n 192.168.55.98 52035 3 1 2 1 1 192.168.55.98 Here is my code. (2 Replies)
Discussion started by: vanitham
2 Replies

5. Shell Programming and Scripting

Search and Replace in Perl

I am trying to write a simple perl script to run on a FreeBSD machine. There are alot of posts here, and I have read so many, yet can not get this script to run. #!/usr/bin/perl -e 's/\r\n/~/' infile.txt outfile.txt I am trying to take a windows text file, move it into Unix, run a script on... (1 Reply)
Discussion started by: mach1
1 Replies

6. Shell Programming and Scripting

perl - replace value

Hello, I am trying to change a value in a param file, with the Run time variable in .sh scripts using perl command , ========================================== Param file $$ID=<0> $$Country=<Country> ========================================== in the .sh script val=33 I am... (5 Replies)
Discussion started by: Shanks
5 Replies

7. Shell Programming and Scripting

how to replace a particular character in perl

Hi, I have a file with two string : aa_bb_cc_def gg_hh_jj_xyz now i want a command in perl script, which gives me the result as : aa_bb_cc.def gg_hh_jj.xyz Can anyone help me on this plz.. thanks in advane. (6 Replies)
Discussion started by: arup1980
6 Replies

8. Shell Programming and Scripting

How replace -- character in perl

Hi All, I am having below issue could anybody help me. $x= SELECT * FROM EMP --xyz this change is done in q2; I want delete the charchters from -- to till the end. I want $x to be $x= SELECT * FROM EMP; Thanks, Vijay G (1 Reply)
Discussion started by: gvk25
1 Replies

9. Shell Programming and Scripting

Perl value lookup and replace

Hi, I have an input file and a config file which I need to lookup values in using Perl: Input file: ID, Value COMP0,0 COMP1,1 COMP2,2 COMP3,3 COMP4,3 COMP5,5Config file: ID, Operation COMP0,((@COMP1@ + @COMP2@ + @COMP3@) / @COMP4@) + @COMP5@Expected output: ID, Value COMP0,7 # This... (0 Replies)
Discussion started by: Subbeh
0 Replies

10. Shell Programming and Scripting

Search and replace (perl)

How can I achieve this? Perl would be awesome. Input string a_b c //Note there is a blank here Needed Output a_b_c Thanks (4 Replies)
Discussion started by: dragonpoint
4 Replies
Gtk2::PageSetup(3pm)					User Contributed Perl Documentation				      Gtk2::PageSetup(3pm)

NAME
Gtk2::PageSetup - wrapper for GtkPageSetup HIERARCHY
Glib::Object +----Gtk2::PageSetup METHODS
pagesetup = Gtk2::PageSetup->new pagesetup = Gtk2::PageSetup->new_from_file ($file_name) o $file_name (localized file name) May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.12 pagesetup = Gtk2::PageSetup->new_from_key_file ($key_file, $group_name) o $key_file (Glib::KeyFile) o $group_name (string or undef) May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.12 double = $setup->get_bottom_margin ($unit) o $unit (Gtk2::Unit) $setup->set_bottom_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) double = $setup->get_left_margin ($unit) o $unit (Gtk2::Unit) $setup->set_left_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) $setup->load_file ($file_name) o $file_name (string) May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.14 $setup->load_key_file ($key_file, $group_name) o $key_file (Glib::KeyFile) o $group_name (string or undef) May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.14 pageorientation = $setup->get_orientation $setup->set_orientation ($orientation) o $orientation (Gtk2::PageOrientation) double = $setup->get_page_height ($unit) o $unit (Gtk2::Unit) double = $setup->get_page_width ($unit) o $unit (Gtk2::Unit) double = $setup->get_paper_height ($unit) o $unit (Gtk2::Unit) $setup->set_paper_size_and_default_margins ($size) o $size (Gtk2::PaperSize) papersize = $setup->get_paper_size $setup->set_paper_size ($size) o $size (Gtk2::PaperSize) double = $setup->get_paper_width ($unit) o $unit (Gtk2::Unit) double = $setup->get_right_margin ($unit) o $unit (Gtk2::Unit) $setup->set_right_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) $setup->to_file ($file_name) o $file_name (localized file name) May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.12 $setup->to_key_file ($key_file, $group_name) o $key_file (Glib::KeyFile) o $group_name (string or undef) Since: gtk+ 2.12 double = $setup->get_top_margin ($unit) o $unit (Gtk2::Unit) $setup->set_top_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) ENUMS AND FLAGS
enum Gtk2::PageOrientation o 'portrait' / 'GTK_PAGE_ORIENTATION_PORTRAIT' o 'landscape' / 'GTK_PAGE_ORIENTATION_LANDSCAPE' o 'reverse-portrait' / 'GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT' o 'reverse-landscape' / 'GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE' enum Gtk2::Unit o 'pixel' / 'GTK_UNIT_PIXEL' o 'points' / 'GTK_UNIT_POINTS' o 'inch' / 'GTK_UNIT_INCH' o 'mm' / 'GTK_UNIT_MM' SEE ALSO
Gtk2, Glib::Object COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::PageSetup(3pm)
All times are GMT -4. The time now is 03:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy