Sponsored Content
Operating Systems HP-UX Add a column at the end of all the lines in a file Post 96509 by ruthless on Friday 20th of January 2006 01:41:14 PM
Old 01-20-2006
Hi Mona,

The exact script what I tested is
#!/bin/ksh
$file="/A/B/C/D/E/"mat.dtd
sed 's/^\(.*\)$/&\|D/' mat.dtd > $file_temp
mv "$file_temp" "xdm.dtd"

and the output I am getting is(as on the screen)

./test1.ksh[2]: =/A/B/C/D/E/mat.dtd: not found
a|b|s|C|r|q|r|D
b|s|r|e|o|s|k|D
p|i|e|w|m|e|t|D
1|2|3|4|5|6|g|D
Z|Q|R|T|S|L|j|D
1|d|x|a|p|y|m|D
mv: : cannot access: No such file or directory

When I am using ur first solution ,its works fine, but for that I need to work in the same shell.
For the above code,it is not able to access the source file(mat.dtd) from the location mentioned.It is taking the contents of the file only becos I am running code in the same dir and also not able to move back to the original file.

Could u pls find the mistake I am doing???

Thanks again.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Blank Lines - End of file

Hi all I need to strip blank lines from the end of a file. I have searched and found topics on how to strip lines from the entirety of a file - however I need to limit this to only the last 3-4 lines. Any ideas? Thanks (4 Replies)
Discussion started by: saabir
4 Replies

2. Shell Programming and Scripting

Add end of char \n on end of file

Hi, I want to add \n as a EOF at the end of file if it does't exist in a single command. How to do this? when I use command echo "1\n" > a.txt and od -c a.txt 0000000 1 \n \n 0000003 How does it differentiate \n and eof in this case? Regards, Venkat (1 Reply)
Discussion started by: svenkatareddy
1 Replies

3. Shell Programming and Scripting

deleting the lines at the end of the file.

I have a text file with two coulmn first column is just used in to show the line number, these line number are not there in the real file. I want to delete the line 16(in this file) here, even tough there is no data inside it . this empty line is causing me a problem by throwing me garbage... (12 Replies)
Discussion started by: shashi792
12 Replies

4. Shell Programming and Scripting

Select lines in which column have value greater than some percent of total file lines

i have a file in following format 1 32 3 4 6 4 4 45 1 45 4 61 54 66 4 5 65 51 56 65 1 12 32 85 now here the total number of lines are 8(they vary each time) Now i want to select only those lines in which the values... (6 Replies)
Discussion started by: vaibhavkorde
6 Replies

5. Shell Programming and Scripting

Remove lines that match string at end of column

I have this: 301205 0000030000041.49000000.00 2011111815505 908 301205 0000020000029.10000000.00 2011111815505 962 301205 0000010000027.56000000.00 2011111815505 3083 312291 ... (2 Replies)
Discussion started by: herot
2 Replies

6. Shell Programming and Scripting

Script to add backslashes to end of certain lines of text

I'd like to write up notes in a relatively readable format and then use a shell script to add LaTeX formatting. Specifically, I'm trying to figure out how to add the LaTeX newline character (\\) to the end of lines without \begin{} or \end{} statements example notes file: \begin{enumerate} --... (2 Replies)
Discussion started by: icskittles
2 Replies

7. Shell Programming and Scripting

Put the lines from file A to end of lines in file B

I really can't figure this one out. I have 2 files, one file is a list of hostnames and the other is a list of their corresponding IPs: fileA: example.com another.org thirdie.net fileB: 1.1.1.1 2.2.2.2 3.3.3.3 I want to create a fileC that looks like: example.com 1.1.1.1... (2 Replies)
Discussion started by: zstar
2 Replies

8. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

9. Shell Programming and Scripting

Add column to end of each line with ´awk´

Hi, I have data with approximately 300 columns. I want to add a column to the end of each column with the value "1". Is there a way that I can do this is ´awk´ without having to specify each individual column. For instance, my data looks like: pvb 1 2 3 4 5 ....... 300 fdh 3 4 5 2 4 ......... (4 Replies)
Discussion started by: owwow14
4 Replies

10. UNIX for Dummies Questions & Answers

Search a file for certain strings and add them to the end of certain lines

I have a log file which lists groups and users in the following format GROUP1 user1 user2 user3 GROUP2 user4 user5 user6 GROUP3 user7 user8 I need to change the format to: user1|GROUP1 user2|GROUP1 user3|GROUP1 user4|GROUP2 (3 Replies)
Discussion started by: Angela S
3 Replies
DACS_VERSION(8) 					     DACS Web Services Manual						   DACS_VERSION(8)

NAME
dacs_version - display DACS version information SYNOPSIS
dacs_version [dacsoptions[1]] DESCRIPTION
This program is part of the DACS suite. The dacs_version web service displays version information about DACS and other third-party packages that have been compiled into DACS. If XML output is selected, a document conforming to dacs_version.dtd[2] is returned. Note This program is also available as a DACS utility, dacsversion(1)[3]. Because dacs_admin(8)[4] provides the same functionality and more, dacs_version may be removed in a future release. OPTIONS
Web Service Arguments The standard CGI arguments[5] are understood. DIAGNOSTICS
The program exits 0 if everything was fine, 1 if an error occurred. SEE ALSO
dacs(1)[6] AUTHOR
Distributed Systems Software (www.dss.ca[7]) COPYING
Copyright2003-2012 Distributed Systems Software. See the LICENSE[8] file that accompanies the distribution for licensing information. NOTES
1. dacsoptions http://dacs.dss.ca/man/dacs.1.html#dacsoptions 2. dacs_version.dtd http://dacs.dss.ca/man/../dtd-xsd/dacs_version.dtd 3. dacsversion(1) http://dacs.dss.ca/man/dacsversion.1.html 4. dacs_admin(8) http://dacs.dss.ca/man/dacs_admin.8.html 5. standard CGI arguments http://dacs.dss.ca/man/dacs.services.8.html#standard_cgi_args 6. dacs(1) http://dacs.dss.ca/man/dacs.1.html 7. www.dss.ca http://www.dss.ca 8. LICENSE http://dacs.dss.ca/man/../misc/LICENSE DACS 1.4.27b 10/22/2012 DACS_VERSION(8)
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy