03-27-2010
Thanks a lot Alister. It's been more useful comment for me.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Does anyone know if its possible to add something like an end of line like c or java in unix?
dirs=/home/nosnam
var=''
for dir in $dirs
do
listDirs=`ls -d1 $dir/*`
for eachList in $listDirs
do
listRepos=`du -ks $eachList | awk '{ x+=$1 }; END { print x... (4 Replies)
Discussion started by: nosnam
4 Replies
2. Shell Programming and Scripting
Hi,
I need some help in knowing how I can append tabs at the end of each line...
The data looks something like this:
field1, field2, field3, field4
1 2
3 4 5
I have values in field1 and field 2 in the first row and I would like to append tab on field3 and field4 for the first row..and in... (6 Replies)
Discussion started by: madhunk
6 Replies
3. UNIX for Advanced & Expert Users
Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.
Can anyone suggest
The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'
how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies
4. Shell Programming and Scripting
hi,
i have file which is having large sql query
eg :
i am executing this sql file but now i want to add ; after query on same line
i.e. i should look like
any idea how to achieve it ? (6 Replies)
Discussion started by: crackthehit007
6 Replies
5. Shell Programming and Scripting
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies
6. Shell Programming and Scripting
Hello
How can I add a string (always the same) at the end of a specific line in a file...
The file is:
000000001 041 L $$aspa
000000001 088 L $$aJ.E.N. 551
000000001 090 L $$aINFORMES JEN
000000001 100 L $$aautor 1
----
000000002 041 L $$aeng
000000002 088 L $$aJ.E.N. 1... (13 Replies)
Discussion started by: ldiaz2106
13 Replies
7. Shell Programming and Scripting
How to add a comma at the end of each line in this file?30 1412
30 3352
30 5254
30 5543
30 7478
3 28
3 30
3 39
3 54
3 108
3 152
3 178
3 182
3 214
3 271
3 286
3 300
3 348
3 349
3 371 (3 Replies)
Discussion started by: gunjan
3 Replies
8. Shell Programming and Scripting
Hello,
file.dat
1,2,3,4,5,6,7,8
1,2,3,4,5,6
1,2,3,4
I need to output the value in the third column from the end:
6
4
2
Thanks! (2 Replies)
Discussion started by: palex
2 Replies
9. Shell Programming and Scripting
i want to add a white-space at the end of each line for my inp.file, but when i do it, the result is a new line with a white-space between each line!
my input:
2012 0811 1223 15.2 L 38.393 46.806 9.0 Teh 78 0.5 6.5LTeh 1
GAP=74 ... (5 Replies)
Discussion started by: saeed.soltani
5 Replies
10. Shell Programming and Scripting
Seems simple but ive been searching for a good hour of so
I have a text file and would like to add a string to the end of line 5 ( as an example)
to ake tings hard the line number we have to add the text to is stored in a variable cunningly name $Line_to_append
any ideas on how this could... (2 Replies)
Discussion started by: dunryc
2 Replies
LEARN ABOUT CENTOS
zip_set_file_comment
ZIP_SET_FILE_COMMENT(3) Library Functions Manual ZIP_SET_FILE_COMMENT(3)
NAME
zip_set_file_comment - set comment for file in zip
LIBRARY
libzip (-lzip)
SYNOPSIS
#include <zip.h>
int zip_set_file_comment(struct zip *archive, zip_uint64_t index); "const char *comment" "int len"
DESCRIPTION
The zip_set_file_comment function sets the comment for the file at position index in the zip archive to comment of length len. If comment
is NULL and len is 0, the file comment will be removed.
RETURN VALUES
Upon successful completion 0 is returned. Otherwise, -1 is returned and the error information in archive is set to indicate the error.
ERRORS
zip_set_file_comment fails if:
[ZIP_ER_INVAL]
index is not a valid file index in archive, or len is less than 0 or longer than the maximum comment length in a zip file
(65535).
[ZIP_ER_MEMORY]
Required memory could not be allocated.
SEE ALSO
libzip(3), zip_get_archive_comment(3), zip_get_file_comment(3), zip_set_archive_comment(3)
AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
NiH March 10, 2009 ZIP_SET_FILE_COMMENT(3)