08-25-2008
Please, give us examples of input and output files.
Jean-Pierre.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear All,
I need to add a header of one line to an already existing file.
I know that it can be achieved by the following:
echo "Header" > newfile
cat file1 >> newfile
But my problem is that file is huge and there is no space for creating a new file every time. Is there a way that I can... (5 Replies)
Discussion started by: shash
5 Replies
2. UNIX for Dummies Questions & Answers
i have a file called motors with 3 columns separated with tabs eg:
car make reg
i want to create a executable file that will add a line with data eg:
car make reg
benz s600 t35778
can you please show me how to do this? (7 Replies)
Discussion started by: fletcher
7 Replies
3. Shell Programming and Scripting
Hi Friends,
I want to know the command to add a new file in a existing tar file.
For Ex:
I have a tar file file1.tar with the contents
one.txt
two.txt
three.txt
Now I need to add file four.txt to this existing tar file, how can I do it?
Thanks in advance (4 Replies)
Discussion started by: mr_manii
4 Replies
4. Shell Programming and Scripting
Hi All ,
Kindly help me with this soln
awk '{printf "%s %7s \n", $1,$c}' infile
where
value of variable c I am externally giving input
But executing the above command shows all the columns of infile where as I want only 1st column of infile and 2nd column should print value c (8 Replies)
Discussion started by: Pratik4891
8 Replies
5. Shell Programming and Scripting
I have a file with 50,000 records in it, i have a requirement to use the same 50,000 records and add them 4 times to the same file to make a total of 200,000 records. I was wondering how to do this using ksh. Any help is greatly appreciated. (2 Replies)
Discussion started by: vpv0002
2 Replies
6. Shell Programming and Scripting
Hi all,
I need help to add additional data from file2 to existing data in file 1 using awk, sed or perl. the ID in file 1 should match against field $3 in file2
file1
#this is a new game
ID HR_1
BASE1 30
BASE2 37
DETAIL No
TYPE L
@@
ID HR_10
BASE1 6030
BASE2 ... (4 Replies)
Discussion started by: redse171
4 Replies
7. Shell Programming and Scripting
Hi!
I would need some help to add the last two columns of one file into another file using awk (or something similar).
For example, I have:
file 1: file 2:
car book day root lag
bar look pay boot tag
tar took may moot sag
I want to have:... (5 Replies)
Discussion started by: coconaza
5 Replies
8. Shell Programming and Scripting
Hi,
I have a data file with :
01/28/2012,1,1,98995
01/28/2012,1,2,7195
01/29/2012,1,1,98995
01/29/2012,1,2,7195
01/30/2012,1,1,98896
01/30/2012,1,2,7083
01/31/2012,1,1,98896
01/31/2012,1,2,7083
02/01/2012,1,1,98896
02/01/2012,1,2,7083
02/02/2012,1,1,98899
02/02/2012,1,2,7083
I... (1 Reply)
Discussion started by: himanish
1 Replies
9. Shell Programming and Scripting
Hello
I have a file as below
chr1 start ref alt code1 code2
chr1 18884 C CAAAA 2 0
chr1 135419 TATACA T 2 0
chr1 332045 T TTG 0 2
chr1 453838 T TAC 2 0
chr1 567652 T TG 1 0
chr1 602541 ... (2 Replies)
Discussion started by: plumb_r
2 Replies
10. Shell Programming and Scripting
Input File 1
cat S1.txt
MI0043 2731 miR-1
Input File 2
cat S4.txt
MI006 310 CiR-1
MI057 10 CiR-24
MI750 5 CiR-24
Desired Output File 1
cat S1.txt.out
MI0043 2731 miR-1 S1.txt
Desired Output File 2
cat S4.txt.out
MI006 310 CiR-1 S4.txt (3 Replies)
Discussion started by: perl_beginner
3 Replies
LEARN ABOUT OPENSOLARIS
asa
asa(1) User Commands asa(1)
NAME
asa - convert FORTRAN carriage-control output to printable form
SYNOPSIS
asa [-f] [file]...
DESCRIPTION
The asa utility will write its input files to standard output, mapping carriage-control characters from the text files to line-printer con-
trol sequences.
The first character of every line will be removed from the input, and the following actions will be performed.
If the character removed is:
SPACE The rest of the line will be output without change.
0 It is replaced by a newline control sequence followed by the rest of the input line.
1 It is replaced by a newpage control sequence followed by the rest of the input line.
+ It is replaced by a control sequence that causes printing to return to the first column of the previous line, where the rest of
the input line is printed.
For any other character in the first column of an input line, asa skips the character and prints the rest of the line unchanged.
If asa is called without providing a filename, the standard input is used.
OPTIONS
The following option is supported:
-f Start each file on a new page.
OPERANDS
The following operand is supported:
file A pathname of a text file used for input. If no file operands are specified, or `-' is specified, then the standard input will be
used.
EXAMPLES
The command
a.out | asa | lp
converts output from a.out to conform with conventional printers and directs it through a pipe to the printer.
The command
asa output
shows the contents of file output on a terminal as it would appear on a printer.
The following program is used in the next two examples:
write(*,'(" Blank")')
write(*,'("0Zero ")')
write(*,'("+ Plus ")')
write(*,'("1One ")')
end
Both of the following examples produce two pages of output:
Page 1:
Blank
ZeroPlus
Page 2:
One
Example 1 Using actual files
a.out > MyOutputFile
asa < MyOutputFile | lp
Example 2 Using only pipes
a.out | asa | lp
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of asa: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 All input files were output successfully.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
lp(1), attributes(5), environ(5), standards(5)
SunOS 5.11 18 Apr 1995 asa(1)