It would help if you showed us what output you had hoped to produce with your changes to the code I suggested. And, I'm not sure that I understand why you're getting the diagnostic that you showed us. (I don't think I've ever seen awk complain about line 0 in an input file, I don't see anything in your code where the string d is immediately followed by an open parenthesis, and I thought AIX utilities always included an error number in diagnostic messages.) But, making some guesses and assuming that you want to print the string specified by the parameter passed to your shell script as the first field in the output (instead of the 1st line in the 1st input file), you might get what you want by making the following three changes to your script:
1. Delete:
2. Change:
to:
3. And change:
to:
Then try running your modified script and see if that does what you want.
Your reference to $G inside the awk script doesn't work because shell variables are not expanded inside the single quotes surrounding your awk script, double quoting a string in an awk program make the enclosed string literal, and $G in an awk program expands to the contents of the field number specified by the contents of the awk variable named G (not to the contents of the shell variable named G from the shell script that invoked awk.
goodpeople...
i have following script which collects info from tab and then generates csv file. all is good except 3 digt and 4 digit enties from tab
Issue here is that csv file is not okay with 3 digit and 4 digit entries that reside in tab.
script...
#!/bin/ksh
#
# Script to send... (2 Replies)
I have been trying to find a good solution for this seemingly simple task for 2 days, and I'm giving up and posting a thread. I hope someone can help me out!
I'm on HPUX, using sqlplus, mailx, awk, have some other tools available, but can't install stuff that isn't already in place (without a... (6 Replies)
Hi All,
I am trying to create a CSV file within a shell script test.ksh and the code snippet is something like below:
#!/usr/bin/ksh
# Set required variables.
. $HOME/.prof
# Output file path
Group1=/tmp/G1.csv
Group2=/tmp/G2.csv
Group3=/tmp/G3.csv
$ORACLE_HOME/bin/sqlplus -s... (2 Replies)
Hello All, I'm able to achieve my goal of creating a fixed width file from a comma delimited but I know I'm not doing it as efficiently as possible.
Original File
checksab
004429876883,O,342040,981.98,10232014
004429876883,O,322389,2615.00,10232014... (6 Replies)
Hi,
I have a file of csv data, which looks like this:
file1:
1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628
2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Hi, all
I want to sort a csv file based on timestamp from oldest to newest and save the output as csv file itself. Here is an example of my csv file.
test.csv
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0739.JPG,2015:02:17 11:32:21
/home/intannf/foto/IMG_0749.JPG,2015:02:17 11:37:28... (10 Replies)
Hi,
I have another problem. I want to sort another csv file by the first field.
result.csv
SourceFile,Airspeed,GPSLatitude,GPSLongitude,Temperature,Pressure,Altitude,Roll,Pitch,Yaw
/home/intannf/foto5/2015_0313_090651_219.JPG,0.,-7.77223,110.37310,30.75,996.46,148.75,180.94,182.00,63.92 ... (2 Replies)