This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Adding a variable value to the text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Adding a variable value to the text file" Watch "Adding a variable value to the text file" New topic

Adding a variable value to the text file

Pavan Math

Joined: Jul 09, 2013
Posts: 1

New to shell scripting.
I have a .txt file with values


My requirement is to pick a column value from database and add it to the .txt file values

say 1,abc,123,sh1-123,

Right now I am using
sed 's/"$l_shipment_number",/' <file_name>

where l_shipment_number=`sqlplus -s $FCP_LOGIN <<!!
SET head off
SET feed off
SET term off
SELECT DISTINCT shipment_number
FROM table
WHERE processed_file_name = <>

Now, I am not getting the value as needed in such a case.
Can you please let me know what the issue here is ?
Ivan Jozsef Balazs

Joined: May 22, 2012
Posts: 968
sed 's/"$l_shipment_number",/'

The sed program seems broken?: there is no closing /
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Adding a variable value to the text file
It's not a secret anymore!