Search Results

Search: Posts Made By: Parrakarry
4,589
Posted By bartus11
cat <<EOF > script.awk { do stuff } ...
cat <<EOF > script.awk
{
do stuff
}
EOF
4,589
Posted By Corona688
ctrl-d is not a "cat" thing by the way, it's a...
ctrl-d is not a "cat" thing by the way, it's a terminal thing. It forces the terminal to send an end-of-file condition. If you do ctrl-d just at your prompt, it will probably log you out.

What...
4,589
Posted By Corona688
Yes. If you don't have it, try 'pico', its...
Yes. If you don't have it, try 'pico', its predecessor.

vi-hater's cheat sheet for vi:

i: Stop beeping at me and enter writing mode you stupid program
esc-:-w-q-enter: Save and quit
...
1,340
Posted By panyam
if ( $i ) { ...
if ( $i )
{
print "<entry name=\"KWName"x"\">"$i"</entry>"
x=x+1;
}
2,318
Posted By Yoda
I would suggest using awk because it will work...
I would suggest using awk because it will work for any number of fields in your input file:
awk -F, '
{
print "<section name=\"Query" NR "\">"
for ( i = 1;...
2,318
Posted By Yoda
If your requirement is to get the comma separated...
If your requirement is to get the comma separated values into different variables, then why use awk?
#!/bin/ksh

while IFS="," read DOC PRID ORG NAME
do
echo "$DOC"
echo "$PRID"...
2,318
Posted By juzz4fun
if you don't want space as default field...
if you don't want space as default field separator, you can define one using OFS
BEGIN{FS=OFS=","} or awk -F, '{.......}' OFS=\, input
2,318
Posted By PikK45
awk is working fine. You may have to change...
awk is working fine.

You may have to change the IFS while reading :)
2,318
Posted By RudiC
It's not awk, it's the read command splitting the...
It's not awk, it's the read command splitting the input at spaces (awk removed the commas before). Why don't you read that file immediately likeIFS="," read DOC ORG NAME REST?

Rats, One : Nil for...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 06:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy