06-06-2011
@itkamaraj
The separator in "cat -v" is a tab character.
10 More Discussions You Might Find Interesting
1. 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
2. UNIX for Dummies Questions & Answers
Ok, this is a unique question.
Say I have a word like "jamamamama" in a file called foo.bar.
Now, how do you get the line number that the word "jamammama" exist in the file foo.bar without having to go into the foo.bar file to edit it?
is there a command i can run on the foo.bar... (4 Replies)
Discussion started by: SkySmart
4 Replies
3. Shell Programming and Scripting
Hi, there
I have a file with tab and space as field separator. I need to assign values to variables then work with them, line by line. The code I wrote only works when each line has only one word. It doesn't work for the current situation.
for line in `cat file.txt`; do
ID=`awk '{print... (4 Replies)
Discussion started by: cwzkevin
4 Replies
4. Shell Programming and Scripting
Hi All,
I have been using a program on windows called AutoKey.
My environment at work is Linux and I have been experimenting with expect. Very powerful. I can move my AutoKey scripts to Linux using Expect once I am educated on how to read from a file using Expect.
My application would be... (1 Reply)
Discussion started by: quemalr
1 Replies
5. Shell Programming and Scripting
I am trying to assign a string of numbers with their decimals to a variable. The code reads a file called 'log'. I have not included the entire file since it's huge.
The line is:
Tagging release with the label program-2.8.114...My code:
BUILDNUMFORSIT=$(egrep 'Tagging release with the... (3 Replies)
Discussion started by: sgffgs
3 Replies
6. Shell Programming and Scripting
Input are file and file1
file contains
store.bal
product.bal
category.bal
admin.bal
file1 contains
flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0
store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies
7. Shell Programming and Scripting
I've got a file that looks like this (spaces before first entries intentional):
12345650-000005000GL140227 ANNUAL HELC FEE EN
22345650-000005000GL140227 ANNUAL HELC FEE EN
32345650-000005000GL140227 ANNUAL HELC FEE EN
I want to read through the file line by line,... (6 Replies)
Discussion started by: Scottie1954
6 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am new to shell scripting. Need help with the below requirement.
I need help to read a log file and line containing word ORA needs to be captured into a variable and the values of the variable need to be inserted into a table.
For E.g. file test.sql has below error:
ORA-01017:... (3 Replies)
Discussion started by: ricsharm
3 Replies
9. Shell Programming and Scripting
Hello,
I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop ,
while IFS=: read -r line
do
set $dsc=$line
echo 'printing line variable ' $line... (1 Reply)
Discussion started by: ParthThakkar
1 Replies
10. UNIX for Beginners Questions & Answers
i have this basic code that i wrote to read a file and place it's values to an array. the source/input file will have multiple strings on it that is separated by a whitespace.
sample_list.txt file contents:
ACCT1 TABLE1
ACCT2 TABLE2
ACCT3 TABLE3
script file: sample_list.sh
... (3 Replies)
Discussion started by: wtolentino
3 Replies
LEARN ABOUT DEBIAN
dtfits
dtfits(1) General Commands Manual dtfits(1)
NAME
dtfits - display FITS table
SYNOPSIS
dtfits <table>
DESCRIPTION
dtfits dumps the contents of a FITS table in an ASCII format, either into a user-specified file or on stdout. The output is formatted on a
fixed number of columns to make it readable by human beings. Additional informations are printed out before the table values are dumped,
these informations can be skipped by using the -d option.
Last, if you want to dump the table into an easily parsable format (for a piece of software), you might want to use the -s option which
specifies a character to use as separator. All data fields will be printed out separated by this character only. This allows to use string
parsers to cut down the output lines into tokens by looking for this separator. Fields (lines) will still be delimited by the end-of-line
character. This option produces ASCII tables which are easy to parse for a piece of software but mostly unreadable to human beings.
Notice that dtfits only accepts one single FITS table in input.
OPTIONS
-d Skip information output about the table and column names. Outputs only the table values. Beware that if the FITS file contains sev-
eral extensions, they will all appear one after another, separated only by two blank lines. In that case, it would be preferrable to
keep the complete output and parse out the returned stream to differentiate which data come from where.
-s <char>
Use the character <char> as separator in output. This option is useful if you want to produce a table that should be parsed by a
piece of software (see above description). The separator can only be a single non-null character. To avoid special characters being
interpreted by the shell, it is recommended to provide this character always between simple or double quotes. Example:
dtfits -s '&' table.tfits
If you want to use a special character as separator, such as a tab, use ^V to insert your character, such as:
dtfits -s '^V<TAB>' table.tfits
which means: you type CTRL-V and then the tab key.
SEE ALSO
dfits
FILES
FITS tables are stored into extensions. If there are several tables in a file, they will all be displayed one after another in the same
output stream.
22 Dec 1999 dtfits(1)