Sponsored Content
Top Forums Shell Programming and Scripting Append the end of each line in a file with a given string Post 302396290 by nmattam on Thursday 18th of February 2010 05:59:38 AM
Old 02-18-2010
Append the end of each line in a file with a given string

Hi friends,

I have a file containing many lines as follows.

Code:
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\ADBasicView.java@@\main\v6.4.0_pit_a

I would like to append the string "\0" at the end of each line in the file. The output should look like:

Code:
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a\0
M:\mmarimut_v6.4.0_pit_01\ADBasicView.java@@\main\v6.4.0_pit_a\0

I tried this command but in vain. Please help me. Thanks in advance.

Code:
awk '{print $0,"\0"}' C:\LOC\v6.4.0_test.txt > C:\LOC\v6.4.0_awktest.txt


Last edited by Franklin52; 02-18-2010 at 07:19 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append text at end of the first line in a file

Hi I need to append some text @ end of the first line in a file. like myfile.txt list = a,b,c list.a=some.. I give the arg "d" . now it append at end of first line list=a,b,c,d list.a=some... Please help me out this (7 Replies)
Discussion started by: catgovind
7 Replies

2. Shell Programming and Scripting

append a character at end of each line of a file

Hi, i want to append a character '|' at end of each line of a file abc.txt. for example if the file abc.txt conatins: a|b|c 1|2|33 w|2|11 i want result file xyz.txt a|b|c| 1|2|33| w|2|11| I know this is simple but sumhow i am not able to reach end of line. its urgent, thanks for... (4 Replies)
Discussion started by: muaz
4 Replies

3. Shell Programming and Scripting

Line Count and Append it to the end of the file.

Hi, I want to get a Line count of a file and append that at the end of the file. The Line count should not include the Headers : ------------------ COL1,COL2,COL3 123,abc,011 111,abd,0212 Record Count: 2 ------------------- Thanks. (7 Replies)
Discussion started by: smc3
7 Replies

4. UNIX for Dummies Questions & Answers

HOWTO Append String to End of Line

I have a comma delimited text file and need to appened ",000000" to the end of every line. For example: Before: "D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll $" ,1103.45 After: "D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll... (3 Replies)
Discussion started by: bggibson
3 Replies

5. Shell Programming and Scripting

How can I append a string at the end of a line in a file

Hi, guys. I have one question: I have a file called "group", the contents of it is below: ******************************** ... test:x:203: sales:x:204: repair:x:205: research:x:206:brownj ... *********** Now I want to add string ",sherrys" at the end of "research:x:206:brownj", so... (5 Replies)
Discussion started by: daikeyang
5 Replies

6. Shell Programming and Scripting

Append a string at the end of every line in a file

Hi Friends, I have a file with many lines as shown below. /START SAMPLE LINE/ M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a M:\mmarimut_v6.4.0_pit_01\port\Post.java@@\main\v6.4.0_pit_a M:\mmarimut_v6.4.0_pit_01\switchview\View.java@@\main\v6.4.0_pit_a /END SAMPLE LINE/ I... (1 Reply)
Discussion started by: nmattam
1 Replies

7. Shell Programming and Scripting

Search for a string, then append character to end of that line only

I have 2 files that I am working with $ cat file1 server1 server3 server5 server6 server8 $ cat file2 server1;Solaris; server2; SLES; server3;Linux; server4; Solaris; server5;SLES; server6;SLES; server7;Solaris; server8;Linux; (1 Reply)
Discussion started by: snoman1
1 Replies

8. Shell Programming and Scripting

sed - Find a String and append a text end of the Line

Hi, I have a File, which have multiple rows. Like below 123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY 123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY 123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies

9. Shell Programming and Scripting

Append this string to end of each line

Platform: Solaris 10 I have a file like below $ cat languages.txt Spanish Norwegian English Persian German Portugese Chinese Korean Hindi Malayalam Bengali Italian Greek Arabic I want to append the string " is a great language" at end of each line in this file. (3 Replies)
Discussion started by: omega3
3 Replies

10. UNIX for Advanced & Expert Users

Help in adding a string at the end of each line and append files vertically

hi, i need a help in the script , need to append a string at the end of each line of a files , and append the files into a single file vertically. eg file1 has the following columns abc,def,aaa aaa,aa,aaa files 2 has the following rows and columns abc,def,aaa aaa,aa,aaa i... (3 Replies)
Discussion started by: senkerth
3 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 02:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy