Just want to ask if there is a shorter hand to doing this one liner
Hi all,
In Oracle, I am using SQL*Plus and selecting all rows in a table and spooling to a file as pipe delimited. I have to use pagesize 0 but unfortunately, using this option excludes the header and I can't get around having it to display the header fields.
So to get around this, I have to create some header file and combine the output from the non-header output and the header only output. This is working fine, I am just curious if there is a shorter version of the command that I am using to create the header line.
Here is what I am doing at the moment.
Below is the header text file doing a describe of the table:
And this is the command that I am using to convert the content of a.txt to a header file
Then I do a cat a.header.txt a.out.txt > a.xls. Sample a.out.txt is as below:
Final output is as below:
While what am doing at the moment works fine, just want to know if there is a more shorter way of doing it :-)
Hello,
I am working on an Urdu to Hindi dictionary which has the following structure:
a=b
a=c
n=d
n=q
and so on.
i.e. Headword separated from gloss by a =
I am giving below a live sample
بتا=बता
بتا=बित्ता
بتا=बुत्ता
بتان=बतान
بتان=बितान
بتانا=बिताना
I need the following... (3 Replies)
Hello everyone,
I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble.
I have many files each having two columns and hundreds of rows.
first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Hello,
I have the following data file structure:
1234 text
2345 text
3456 text text text
4567 text text text
5678 text text text
6789 text text text
I simply want to delete all of the lines that only have one text column (i.e. the first two lines in this case). The output would be:... (1 Reply)
Hi Folks,
I know my code works, but I'm still a newbie at arrays and how they function.
Is there is shorter way to write my code? I'm taking averages in multiple files and concatenating output into 1 file.
TIA!
for file in *;
do
awk -F"\t" '{a1+=$1}{a2+=$2}{a3+=$3} {a4+=$4}{a5+=$5}... (1 Reply)
What's the correct way to change the initramfs file that's used during boot?
I know that it's a gzipped cpio archive, but when I gunzip, extract, re-archive (without changing any files), and gzip, then the result is that the system does not boot any more. And I even set the cpio archive type.
... (18 Replies)
i have a script in sh. with awk, e.g. want to list all the contents of a subdirectory an a tabular way.
ej: outoput
directory1
subdirectory1 subdirectory2 subdirectory3
file1 filen file2 filez
file2 ... filen+1 ... (1 Reply)
Hi,
I remember once seeing a way to get the left most string in a word.
Let's say: a="First.Second.Third" (separated by dot)
echo ${a#*.} shows --> Second.Third
echo ${a##*.} shows --> Third
How do I get the the left most string "First" Or "First.Second" ???
Tried to replace #... (2 Replies)
How do you get an awk output into columns i.e.
awk (print $1,$2,$3) doesn't come out into nice columns but lots of lines of txt want something more like.
I am crap
at unix so
give me a
hand thx Rich (3 Replies)