LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-09-2012, 01:14 PM   #16
Alchemikos
Member
 
Registered: Jun 2012
Location: Porto Alegre-Brazil
Distribution: Slackware- 14, Debian Wheezy, Ubuntu Studio, Tails
Posts: 88

Rep: Reputation: 6

Hello

I think it works:

Code:
f1="london 1 1"                                                                                                                                                                    
a=1                                                                                                       
while read line                                                                                           
do 
    echo  "$f1"    >> "S$a"                                                                                                                                                                                         
    echo   "$line" >> "S$a"                                                                                     
    ((a++))                                                                                              
done < f2
Cheers
 
1 members found this post helpful.
Old 07-09-2012, 01:54 PM   #17
iconig
LQ Newbie
 
Registered: May 2012
Posts: 28

Original Poster
Rep: Reputation: Disabled
Yes it does work, I checked it again. Thanks all
 
Old 07-09-2012, 03:15 PM   #18
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,811
Blog Entries: 1

Rep: Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191
Have another look at my code and try to spot the difference
 
Old 07-09-2012, 03:42 PM   #19
iconig
LQ Newbie
 
Registered: May 2012
Posts: 28

Original Poster
Rep: Reputation: Disabled
Just a slight difference between your code and Alchemikos. But it is essentially your code. I used the two and both worked for me. The fault was from me. Thanks again. The best
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check missing header files included from another header file adisan82 Linux - Software 1 01-28-2011 04:57 AM
[exim4] Remove header lines matching received client ip konddor Debian 1 10-23-2009 04:25 AM
Count commas in header and append as many missing from the lines underneath tribal_molecule Programming 1 08-12-2009 07:05 AM
Need help appending text to lines in a file using vi editor tmbrwolf53 Linux - Newbie 3 10-31-2008 04:25 PM
Appending ends of lines in sed Agentrooker Programming 8 08-08-2008 12:19 AM


All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration