Hi, I'm totally new to awk, so thanks in advance for your help.
I want to make a csv file out of a text file I've exported from a database I want to do two things:
1. Change pipes ("|") to commas (",") to make a text file into CSV
2. Remove the second line of the file, which is useless junk.
Here's what I have so far to accomplish #1. I'm struggling on #2. Help?
function pull() {
cat $@ | awk '{gsub(/\|/,","); print;}' > $@.csv;
}
I want to make a csv file out of a text file I've exported from a database I want to do two things:
1. Change pipes ("|") to commas (",") to make a text file into CSV
2. Remove the second line of the file, which is useless junk.
Here's what I have so far to accomplish #1. I'm struggling on #2. Help?
function pull() {
cat $@ | awk '{gsub(/\|/,","); print;}' > $@.csv;
}