BashScripts.org
http://bashscripts.org/forum/

Should be REAL simple...
http://bashscripts.org/forum/viewtopic.php?f=8&t=1689
Page 1 of 1

Author:  cwwilson721 [ Fri Jan 25, 2013 10:30 am ]
Post subject:  Should be REAL simple...

..and my brain can't wrap around it.

I have a file with a list of 'names' (txt-a)
I want it to be ouputted to another file with the names inserted into other text.(txt-b)

Example txt-a
Code:
Allan
Bobby
Charles
...
And so on...
Example txt-b
Code:
Hello Allan go to the left
Hello Bobby go to the left
Hello Charles go to the left
...

And so on...

Note the only thing changing is the name variable

I don't need the txt-b to be separate files outputted, I need all the names from txt-a to all be in txt-b, like the example

NOTE: txt-a has 1723 names... Script is the only way....

Help?

Author:  Watael [ Fri Jan 25, 2013 12:14 pm ]
Post subject:  Re: Should be REAL simple...

Code:
grep -f file-a file-b

Author:  cwwilson721 [ Fri Jan 25, 2013 1:40 pm ]
Post subject:  Re: Should be REAL simple...

Watael wrote:
Code:
grep -f file-a file-b


That has GOT TO BE one of the SILLIEST responses EVER

I need to INSERT the names from txt-a INTO predetermined text at a PREDETERMINED place, and append the entire resultant text to txt-b

Note the OP

txt-a has a LONG list of names, that need to be inserted into a line of text, then output that into a continuous file, that contains ALL the output.

Your response does Diddly-Squat.

Note I am asking for a script, NOT for a grep command that:
#1 Won't do what I'm asking
#2 Outputs NOTHING
#3 Has NOTHING to do with the OP

Author:  Watael [ Fri Jan 25, 2013 2:05 pm ]
Post subject:  Re: Should be REAL simple...

You're so kind, and were so clear about what you want.

I won't even give you a hint.

plonk

Author:  DarthWavy [ Sat Jan 26, 2013 6:38 am ]
Post subject:  Re: Should be REAL simple...

Code:
for name in $(<txt-a); do echo "Hello $name goto the left"; done > txt-b

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group • http://www.phpbb.com