Help in adding a string at the end of each line and append files vertically
hi,
i need a help in the script , need to append a string at the end of each line of a files , and append the files into a single file vertically.
eg
file1 has the following columns
files 2 has the following rows and columns
i want append unix at the end of each files , which will be like the following
later i want to concat file1 and file2 into a single file
i want to do this in a script.. help me on this
thanks
senthil
Last edited by Scott; 10-30-2013 at 01:46 AM..
Reason: Another reminder to use code tags
I have a comma delimited text file and need to appened ",000000" to the end of every line. For example:
Before:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll $" ,1103.45
After:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll... (3 Replies)
Hi,
I have a command "get_data" with some parameters in few *.text files of a directory. I want to first find those files that contain this command and then append the following parameter to the end of the command.
example of an entry in the file :-
get_data -x -m50 /etc/web/getid
this... (1 Reply)
Hi, guys. I have one question:
I have a file called "group", the contents of it is below:
********************************
...
test:x:203:
sales:x:204:
repair:x:205:
research:x:206:brownj
...
***********
Now I want to add string ",sherrys" at the end of "research:x:206:brownj", so... (5 Replies)
Hi Friends, I have a file with many lines as shown below.
/START SAMPLE LINE/
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\port\Post.java@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\switchview\View.java@@\main\v6.4.0_pit_a
/END SAMPLE LINE/
I... (1 Reply)
Hi friends,
I have a file containing many lines as follows.
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\ADBasicView.java@@\main\v6.4.0_pit_a
I would like to append the string "\0" at the end of each line in the file. The output should look... (10 Replies)
After I create printer queues in AIX, I have to append a filter file location within that printers custom file. within lets say test_queue.txt I need to find the row that starts with :699 and then I need to append on the end the string /usr/local/bin/k_portrait.sh.
Now I've gotten the sed... (2 Replies)
I have 2 files that I am working with
$ cat file1
server1
server3
server5
server6
server8
$ cat file2
server1;Solaris;
server2; SLES;
server3;Linux;
server4; Solaris;
server5;SLES;
server6;SLES;
server7;Solaris;
server8;Linux; (1 Reply)
I have two files (csv and vcf) which look exactly like this
S1.csv
func,gene,start,info
"exonic","AL","2309","het"
"exonic","NEF","6912","hom"S1.vcf
##fileinfo
#CHROM POS ID INFO
chr1 4567 rs323211 1/1:84,104,99
chr4 2309 rs346742 1/1:27,213,90
chr6 5834 ... (5 Replies)
Hi,
I have a File, which have multiple rows.
Like below
123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY
123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
I want to search a line which contains PB MO Approver and append... (2 Replies)
Platform: Solaris 10
I have a file like below
$ cat languages.txt
Spanish
Norwegian
English
Persian
German
Portugese
Chinese
Korean
Hindi
Malayalam
Bengali
Italian
Greek
Arabic
I want to append the string " is a great language" at end of each line in this file. (3 Replies)
Discussion started by: omega3
3 Replies
LEARN ABOUT BSD
string
STRING(3) Library Functions Manual STRING(3)NAME
strcat, strncat, strcmp, strncmp, strcasecmp, strncasecmp, strcpy, strncpy, strlen, index, rindex - string operations
SYNOPSIS
#include <strings.h>
char *strcat(s, append)
char *s, *append;
char *strncat(s, append, count)
char *s, *append;
int count;
strcmp(s1, s2)
char *s1, *s2;
strncmp(s1, s2, count)
char *s1, *s2;
int count;
strcasecmp(s1, s2)
char *s1, *s2;
strncasecmp(s1, s2, count)
char *s1, *s2;
int count;
char *strcpy(to, from)
char *to, *from;
char *strncpy(to, from, count)
char *to, *from;
int count;
strlen(s)
char *s;
char *index(s, c)
char *s, c;
char *rindex(s, c)
char *s, c;
DESCRIPTION
These functions operate on null-terminated strings. They do not check for overflow of any receiving string.
Strcat appends a copy of string append to the end of string s. Strncat copies at most count characters. Both return a pointer to the null-
terminated result.
Strcmp compares its arguments and returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater
than, equal to, or less than s2. Strncmp makes the same comparison but looks at at most count characters. Strcasecmp and strncasecmp are
identical in function, but are case insensitive. The returned lexicographic difference reflects a conversion to lower-case.
Strcpy copies string from to to, stopping after the null character has been moved. Strncpy copies exactly count characters, appending
nulls if from is less than count characters in length; the target may not be null-terminated if the length of from is count or more. Both
return to.
Strlen returns the number of non-null characters in s.
Index (rindex) returns a pointer to the first (last) occurrence of character c in string s or zero if c does not occur in the string. Set-
ting c to NULL works.
4th Berkeley Distribution October 22, 1987 STRING(3)