Hi eveyrone,

I'm tryin to build a script that will extract columns from a comma
sepparated or x delimited file. This is what I have so far, but it doesn't
work. I get the following error:

Naix:Bash Naix$ ./extractCol.sh , cutDemo.input 3
awk -F',' '{ print $3 }' < cutDemo.input
awk: '{
awk: ^ invalid char ''' in expression

#!/usr/bin/env bash

DELIMETER="'$1'"
FILE=$2
COLUMNS="'{ print \$$3 }'"

echo "awk -F$DELIMETER $COLUMNS < $FILE"
awk -F$DELIMETER $COLUMNS < $FILE

Any help appreciated.

Ted


-- 
View this message in context: 
http://old.nabble.com/Help-with-script.-tp28598751p28598751.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.


Reply via email to