The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
editing ELF file tejuwala Linux 1 05-17-2008 11:22 PM
Editing file rahul303 Shell Programming and Scripting 4 09-23-2007 10:49 PM
Editing File using awk/sed Mohammed Shell Programming and Scripting 4 05-16-2007 11:00 AM
Editing the File using Awk awk_beginner Shell Programming and Scripting 3 04-06-2007 10:43 AM
Help with editing file dsravan Shell Programming and Scripting 4 01-31-2007 01:59 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-07-2008
aaabbb123123 aaabbb123123 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 3
How to editing a txt file

Hi all,

i am trying to add a word at the end of first line of the txt file. can anyone tell me how to do it, Thanks.
  #2 (permalink)  
Old 03-07-2008
sad_angle's Avatar
sad_angle sad_angle is offline
Registered User
  
 

Join Date: Jun 2001
Location: Madison, WI
Posts: 75
I wish to say 'use a text editor', however, can you explain more? There must be more to it here.
  #3 (permalink)  
Old 03-07-2008
aaabbb123123 aaabbb123123 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 3
sad angle

0000|123568|d|N|3|0000000000000000|S|Y|0|a|P|0|9|001|32|75||123456
0201|-484.00|1570.00|1086.00|0.00|1570.00
0901|

The file look like that and i wanted to add |070308 to the end of first line, see if you can help thanks
  #4 (permalink)  
Old 03-07-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by aaabbb123123 View Post
i am trying to add a word at the end of first line of the txt file. can anyone tell me how to do it.
Code:
word=whatever
{
  IFS= read -r line
  printf "%s %s\n" "$line" "$word"
  cat
} < FILENAME > NEWFILE
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0